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 vicare config flow #56691
Add vicare config flow #56691
Conversation
We require tests for config flows, please add that. |
c761534
to
1c25701
Compare
@emontnemery I added some config flow tests which lead me to also handle authentication erros ;) Sorry for the force-push but the original commit was only modified to be rebased. Also another update to latest PyVicare was necessary due to some REST API changes. |
1c25701
to
4cf8b03
Compare
Do the breaking changes in PyViCare have any impact on the Home Assistant vicare integration? |
There are still failing tests, please fix them. |
Yes, instead of having a single "Device" the API now provides a device with multiple circuits and burners. This allowed the removal of the CONF_CIRCUIT_ID parameter since the integration can now iterate over the data provided by all circuits and create all possible sensors. This could have been done in a separate PR but it would then involve future changes to the configuration schema. I guess we should avoid that. |
Fixed. Sorry for the delay. |
Seems Viessmann is changing things on their API and we won't be able to fix that without the latest PyViCare release (#57304) |
@emontnemery How should we move on. Is this PR ok for a review or should we split it up into a library update PR and a config flow PR? |
@oischinger let's split the PR in two, one adjusting for the new library and one for config flow + multiple burners |
PR for the library update created: #57700 |
With PyViCare 2.8.1 a breaking change was introduced which required changes on sensor and binary_sensor platforms. See Home Assistant Core PR home-assistant/core#57700 As an intermediate step the circuit ID config option is still present but ignored. Now all circuits are supported at the same time. As a 2nd step the option will be removed completely since the integration will introduce setup via the UI (see this PR: home-assistant/core#56691 )
@emontnemery
I'm wondering because I doubt that it's good to have these sort of "stale" PRs around that cannot really be reviewed before the other PR isn't merged. |
You can mark this PR as "draft" and add a note in the PR-description that it will be updated once #57700 is merged 👍 |
2f21ee3
to
da06b6f
Compare
un-drafting this PR. |
Had to convert to draft again. Needs some more work |
019cab7
to
ba8e298
Compare
Finally I would say it's ready for review ;) |
vol.Optional( | ||
CONF_SCAN_INTERVAL, default=DEFAULT_SCAN_INTERVAL | ||
): vol.All(cv.time_period, lambda value: value.total_seconds()), |
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.
Why do we tweak the config schema when moving to a config flow?
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.
Well this change is not really needed since we will delete this at a later point when yaml is officially removed from this integration.
But I still need the CONFIG_SCHEMA in init.py or are you saying I could get rid of the complete section now?
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.
The CONFIG_SCHEMA is needed until the migration step is removed, I just mean there's no value added by modifying it since it's deprecated.
This includes the current HA Core dev branch plus the vicare_config_flow PR: home-assistant/core#56691
Config flow / YAML deprecation - Support discovery via MAC address - Support import of YAML config - Switch to ConfigEntry, get rid of platform setup
ba8e298
to
f05550f
Compare
@emontnemery |
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.
LGTM, thanks @oischinger 👍
I think this PR is missing a documentation PR (and should therefore not have been merged). @oischinger Can you make sure a documentation PR is created? |
Oops, I missed 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.
Please address the comments in a new PR. Thanks!
Proposed change
Adds Config flow / YAML deprecation for Vicare
Type of change
Additional information
Config flow / YAML deprecation
Support discovery via MAC address
Support import of YAML config
Switch to ConfigEntry, get rid of platform setup
This PR fixes or closes issue:
This PR is related to issue:
Link to documentation pull request:
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: