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
Add config flow and device registry to fritzbox integration #31240
Add config flow and device registry to fritzbox integration #31240
Conversation
Points I'm not sure about:
|
Yes, drop fritzdect and let say we replace it with this PR to become one |
Please don't do everything in this PR. This PR should only focus on the config flow addition for this integration. Further PRs are welcome where we replace the fritzdect integration. |
Regarding 3., that's the best practice, ie to connect to the device in the component module and store it in hass.data, when more than one platform relies on the same device instance. |
The drop of fritzdect doesn't belong to this PR directly. It could be done at any time as it's already today not needed anymore. |
@MartinHjelmare @pvizeli And hints here? |
…ant into fritzbox_config_flow
see #31359 |
Why would the same entity be represented by different devices? It sounds like there are two devices that interact and the first device can be actuated by the second device. We will still only represent the first device with a single entity. It doesn't matter for the entity how the first device is actuated. |
AVM has a so called Mesh functionality. All their products can be controlled from every device's web ui. This is the reason why every configured integration can see and control every device. |
The same entity is not allowed to be set up more than once. |
That's why I'm asking. ;-) |
Store the ids of the devices or entities and make sure to not set up the same id more than once. Usually a set is good to store unique items. If the container needs to be accessed more than once or from different module, store it in hass.data. |
OK, I thought there is maybe a built-in helper function. |
@MartinHjelmare Would like to set the quality scale but I'm unsure which is right. |
We shouldn't try to squeeze everything into this PR. Just make sure tests are good and things are working. Then we merge. |
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.
Looks good!
Please update the breaking change paragraph in the PR description so we can copy it directly to the release notes. Briefly describe what changed and what the users need to do to cope with the breaking change. |
I just tested the latest version of this PR as a custom integration. I removed all config items and recreated them in the integrations panel and I get the following issue in the second I create them:
When I remove the integration and restart HA, the error is gone. When I add the integration again, the error is in my log. |
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.
Thanks for the report. I think this should fix that.
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.
Can be merged when build passes.
@MartinHjelmare Thanks for the fix and all your reviews. |
Breaking change
YAML configuration has been deprecated and should no longer be used, it will be removed in one of the next releases.
Proposed change
Add config flow and device registry to
fritzbox
integration.Type of change
Example entry for
configuration.yaml
: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: