-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
Improve hvac_mode compatibility of vicare #66454
Conversation
f55f4b5
to
f008117
Compare
Maybe a bit overdoing it but since it seems you can read the list of modes you could also dynamically build the list instead of having two different dicts depending on what the unit supports. |
I'm not sure if I get this right. Wouldn't that just move the logic? I still need a static mapping to define which vicare_modes match the hvac_modes? |
What I was thinking was given you have a mapping on vicare to HA you can make the HA to vicare mapping dynamic based on supported modes instead of having two different static lists. |
I guess the problem here is that I do not know all possible vicare_modes. Therefore I cannot always create a meaningful mapping. |
Anything else needed to get this merged? |
From the discussion initiated by Frenck it seems nothing changed. |
Sorry guys, I was very busy with other stuff recently. |
612fcdc
to
2c8d183
Compare
Viessmann devices can have varying vicare_modes. This integration maps hvac_modes to vicare_modes without even checking if those vicare_modes are available. This PR improves the situation by a) checking if the vicare_mode for the desired hvac_mode actually exits b) providing only the hvac_modes that are actually supported (meaning: a matching vicare_mode exists) c) Defining an order of vicare_modes that should be used for a given hvac_mode. Example for c): HVACMode.OFF should be VICARE_MODE_FORCEDREDUCED if supported. If not it should be VICARE_MODE_OFF or VICARE_MODE_DHW
2c8d183
to
194825e
Compare
I redid this PR from scratch. Please see the updated description! |
Seems very reasonable to me. |
I believe it's necessary to not do this at startup time. If the heating device is turned off you will not get proper values for vicare_modes. Also in case the API is not reachable the integration should be able to recover by itself. |
Ok I guess for the first argument if the heater isn't replying with states if it's turned off (which seems a bit odd). On the second I guess you should implement available instead if there is a broken connection with the api. |
@frenck can you please have a 2nd look? |
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, @oischinger 👍
Proposed change
Improve hvac_mode compatibility of vicare
Viessmann devices can have varying vicare_modes. This integration maps hvac_modes
to vicare_modes without even checking if those vicare_modes are available.
This PR improves the situation by
a) checking if the vicare_mode for the desired hvac_mode actually exits
b) providing only the hvac_modes that are actually supported (meaning: a matching vicare_mode exists)
c) Defining an order of vicare_modes that should be used for a given hvac_mode.
Example for c):
HVACMode.OFF should be VICARE_MODE_FORCEDREDUCED if supported.
If not it should be VICARE_MODE_OFF or VICARE_MODE_DHW
I'll update the documentation accordingly if the PR gets accepted.
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: