-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix Starkvind fan capabilities and modes being incorrectly exposed #87
Conversation
4c903ff
to
4d08222
Compare
4d08222
to
80d5bee
Compare
You can fix most of the CI errors by running pre-commit: pip install pre-commit
pre-commit install
pre-commit run --all-files Ignoring the fan speed attribute values, just so that I understand correctly, the fan supports |
80d5bee
to
6af6d80
Compare
Done. Both pytest and pre-commit should now pass.
The fan supports 9 speeds, of which only 5 are exposed on the physical interface. The other four speeds are halfway between those speeds and used in auto mode, as well as exposed in the official app. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #87 +/- ##
=======================================
Coverage 95.79% 95.80%
=======================================
Files 61 61
Lines 9324 9340 +16
=======================================
+ Hits 8932 8948 +16
Misses 392 392 ☔ View full report in Codecov by Sentry. |
Improved test coverage, cleaned up some code and addressed one of the review comments. |
d73ab32
to
76ef28e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Fixes home-assistant/core#97440 Previously starkvind exposed 10 speed settings and no modes, where 10% corresponded to auto mode and 20%-100% corresponded to fixed speeds. This patch correctly exposes auto mode as a mode. It also adds support for showing the actual fan speed while auto mode is enabled. Starkvind supports 9 fan speeds. Because 9 doesn't neatly fit into 100% I cheated a bit and divided the 100% into 10% increments, where trying to set the fan to 10% sets it to 20% instead. I believe that this gives the overall better user experience compared to having 11.11% increments. The 5 speed modes present on the physical interface of the device correspond to HA speed settings 20%, 40%, 60% and 100%.
76ef28e
to
f89d17b
Compare
Rebased again because of the conflict caused by #125 |
Do you think it will be possible to get this into HA 2024.9 now that the zha rework has landed in 2024.8? |
I've added a "breaking change" text in the PR description. This should be copy-pasted by whoever bumps the lib in HA. |
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!
Breaking change (for end-users in HA)
The IKEA Starkvind fan modes have been updated. Automations that used to set the fan to 10% speed to switch it to "auto mode" should now be updated to set the preset to "auto."
In auto mode, the actual fan speed is now properly displayed.
For more information, see the PR in the ZHA repo: #87
Proposed change
Fixes home-assistant/core#97440.
Previously, Starkvind exposed 10 speed settings and no modes, where 10% corresponded to auto mode and 20%-100% corresponded to fixed speeds.
This patch correctly exposes auto mode as a mode. It also adds support for showing the actual fan speed while auto mode is enabled.
Starkvind supports 9 fan speeds. Because 9 doesn't neatly fit into 100% I cheated a bit and divided the 100% into 10% increments, where trying to set the fan to 10% sets it to 20% instead. I believe that this gives the overall better user experience compared to having 11.11% increments. This also keeps the previous fixed speeds in HA, instead of changing them all.
The 5 speed modes present on the physical interface of the device correspond to HA speed settings 20%, 40%, 60% and 100%.
Additional information
This depends on home-assistant/core#122033 to work.That PR is no longer needed.Previous PR: home-assistant/core#114854