-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Use temperature of current preset when set fritz HVAC mode to HEAT #126044
Conversation
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.
Hey there @mib1185, @flabbamann, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
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.
Hi @naruxde
thanks for this contribution 👍
Besides the small comment from my side, the test fails - please check this. Don't hesitate to call for help if needed 😉
regards,
Michael
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
4d67742
to
5df75de
Compare
Hi @mib1185! I'm really sorry about what always went wrong 😖. I had even, before the push, made a pytest with |
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.
we now have a regression with tests test_set_temperature_mode_heat
and test_set_hvac_mode_heat
🧐
i've not checked the code yet in detail, so would be grate if you could have a look first.
Yes, I'm just looking at that. We have with the So we would have to change We then generally only have the problem if eco and comfort are set to the same values in the Fritzbox, which mode should we use in Home Assistant. 🤔 - Currently it would be |
I pushed a commit as a suggestion for changing the tests. But maybe you have other ideas 🙂 |
ba11dda
to
8eb015f
Compare
8eb015f
to
6992bfb
Compare
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 think using value_scheduled_preset
is the wrong approach, since it intention was another. It will always return "eco mode", if nextchange_temperature
is not the eco_temperature
, even when nextchange_temperature
is 128 (or 255) (which means not set)
c6c3d23
to
a428cba
Compare
please avoid rebase + force-push. this makes hard to get what has changed since last review, thx 👍 |
I just reset the change from the test in the test_set_temperature_mode_heat function. This is also part of PR #126072, if I understand correctly. |
If the HVAC mode of the Fritzbox thermostats changes from `HVACMode.OFF` to `HVAMode.HEAT`, the current preset (COMFORT / ECO) should be observed. Depending on the status of the current preset, the set temperature of comfort / eco is set as the new temperature.
Co-authored-by: Michael <[email protected]>
The current_preset parameter allows the mock to be set to an active preset. When setting HVACMode.HEAT, the respective temperature of the ECO/COMFORT preset should be set.
e5422dd
to
c5b7a5d
Compare
Hi @mib1185! I hope that worked. I removed my tests and extended your new test with a current_preset parameter. I hope that was okay that I didn't insert a new test like before. |
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.
Hi @naruxde
I thought about it again and unfortunately came to the conclusion, that all the "next change " sensors needs to be fixed. The api returns the comfort temperature as next temperature, when there is no scheduler configured. The only way to detect if a scheduler is configured, is to check the next change time - if it is 0, than there is no scheduler, else it contains a valid future timestamp. I'm already working on a further PR to fix this. Afterwards we should really be able to go ahead with your PR.
thx for your patients 👍
Hi @mib1185! Improvements are always good! I would also have no problem with it if you integrate the "hack" from this PR directly into your PR, which maybe results in a better solution. What ever you like most. I look forward to it when the problem described above is solved, gladly also with a better solution than this 😆. |
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.
Hi @naruxde
we're close to get this ready and no, i won't put this into some of my PRs, because it is your contribution 😉
Please apply the following comments, thx 👍
To distinguish which temperature should be used when setting the `HVAMode.HEAT`, `value_schedules_preset` is now used again, which has been updated since the first commit. If no schedule is active, the comfort_temperature is used. Otherwise, the respective temperature of the current preset. Co-authored-by: Michael <[email protected]>
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.
don't forget to click on "Ready to review" (#126044 (comment)) 😉
Had to test locally 😋 |
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, thx @naruxde 👍
…Fritz!Smarthome (home-assistant#126044) * Use temperature of current preset when set fritz HVAC mode to HEAT If the HVAC mode of the Fritzbox thermostats changes from `HVACMode.OFF` to `HVAMode.HEAT`, the current preset (COMFORT / ECO) should be observed. Depending on the status of the current preset, the set temperature of comfort / eco is set as the new temperature. * fixup do not use value_scheduled_preset Co-authored-by: Michael <[email protected]> * Add current_preset value to test_set_hvac_mode The current_preset parameter allows the mock to be set to an active preset. When setting HVACMode.HEAT, the respective temperature of the ECO/COMFORT preset should be set. * fixup Use the updated value_scheduled_preset function To distinguish which temperature should be used when setting the `HVAMode.HEAT`, `value_schedules_preset` is now used again, which has been updated since the first commit. If no schedule is active, the comfort_temperature is used. Otherwise, the respective temperature of the current preset. Co-authored-by: Michael <[email protected]> --------- Co-authored-by: Michael <[email protected]>
Breaking change
Proposed change
I use the FRITZ! DECT 302 thermostats on my heaters. In the Fritz! Box is a heating plan stored, which sets the temperature to COMFORT or ECO at certain times of the day. If I switch off the heating
HVACMode.OFF
via Home Assistant and turn it on again, the COMFORT temperature is always set, although the schedule for ECO is still active.This change is intended to use the ECO temperature when switching on, if the schedule for ECO is still active, otherwise the COMFORT temperature.
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: