-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Update synology_srm to ScannerEntity #145865
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
base: dev
Are you sure you want to change the base?
Update synology_srm to ScannerEntity #145865
Conversation
Hey there @aerialls, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
username=config[CONF_USERNAME], | ||
password=config[CONF_PASSWORD], | ||
https=config[CONF_SSL], | ||
) |
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.
moved this to get_api, to share the usage for config flow
|
||
def get_extra_attributes(self, device) -> dict: |
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.
moved to ScannerEntity class under extra_state_attributes
|
||
def scan_devices(self): |
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.
this function exists on line 149
86745aa
to
dcb5405
Compare
21b984d
to
877b213
Compare
7a5f05f
to
aa0114c
Compare
ed7f3c5
to
fa1ef1f
Compare
fa1ef1f
to
86e8a9a
Compare
Breaking change
It's converting to a config_flow, so the existing configuration.yaml will no longer work, the UI appropriately says this and documentation will be updated.
Proposed change
As per @frenck, I've reduced the amount of changes to the minimum to update to ScannerEntity.
So that the upstream synology api still worked asynchronously, I added various polling options, including a setup function and config_flow so that it can work as a ScannerEntity. Prior changes (coordinator, string consts, and code quality improvements, more py tests) will come in a future PR.
I'm still new to the structure of the HA codebase, and open if there are better ways to update such things. I took references to mikrotik, asuswrt, freebox, and fritz to help understand ScannerEntity and router type integrations in general. I found limited documentation on the old DeviceScanner, as well as trying to understand a clear path to update DeviceScanner reserved function names to ScannerEntity.
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: