-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Synology DSM services with buttons #57352
Replace Synology DSM services with buttons #57352
Conversation
Hey there @hacf-fr, @Quentame, mind taking a look at this pull request as it has been labeled with an integration ( |
a9e6510
to
6a7a574
Compare
aff7000
to
8acfb5f
Compare
@mib1185 Could you resolve the CI issue in this PR? |
df6b0c2
to
4baa81a
Compare
rebased to solve conflicts |
4baa81a
to
e111ed8
Compare
e111ed8
to
011383a
Compare
rebased to get #64792 in |
Should we still accept the serial for a few versions but warn so they have time to change any automations? |
With this, the new paramater |
Its likely not worth putting users through two breaking changes. |
Some of these services could actually be buttons |
What do you think about to keep the services as is - just deprecate them - and add buttons for shutdown and reboot?
btw. I will remove the poweron service, since it needs a bit more thinking to get it work, since when device is off, the entry is not loaded - so the service is not loaded, too. |
Sounds good to me. |
self.entity_description = description | ||
self.syno_api = api | ||
|
||
self._attr_name = f"{api.network.hostname} {description.name}" | ||
self._attr_unique_id = f"{api.information.serial}_{description.key}" | ||
self._attr_device_info = DeviceInfo( | ||
identifiers={(DOMAIN, api.information.serial)} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to make a base class that sets the device info that is a subset of SynologyDSMBaseEntity
so we don't have the code duplicated here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about inheriting from SynologyDSMBaseEntity
but there is to much in it, which is not needed by a simple button entity. So I decided to add this minimum of device_info to get the buttons connected to the device created by the integration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be cleaner to split up SynologyDSMBaseEntity
to avoid the code duplication.
This PR is already large enough though so it can wait for the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do this in a follow-up PR soon 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and working as expected
Breaking change
The services
reboot
andshutdown
are deprecated and will be removed in future release. Please use the new button entities.Proposed change
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: