-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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 fan speed regression for some xiaomi fans #78406
Conversation
This pull request needs to be manually signed off by @home-assistant/core before it can get merged. |
Hey there @rytilahti, @syssi, @starkillerOG, @bieniu, mind taking a look at this pull request as it has been labeled with an integration ( |
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, nice cleanup, too! 👍 Let's wait for someone with a test device to verify that it's working, but I'm marking this already for the next patch release.
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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!
Quick question, how do we make sure that somebody tests it? I only have the 1c fan and already verified the behavior but cannot test for other fan types. Technically the code is reverted for the other fans to the known-to-be-working state, but I cannot verify this. |
Alas, there is no easy way for that, besides having enough unit tests. In this case, considering the current level of code coverage, I'd argue against adding more tests if only done for a single device. I'm slowly trying to move all relevant information to python-miio, which will make it the only ground truth for device specifics, but it's a slow process as I don't have test devices either. @peteh considering you know how to do development work, could you please consider checking out rytilahti/python-miio#1495 and adding the necessary metadata decorators to python-miio to help remove hardcoding? There is a link to my homeassistant fork that makes use of the library-provided information to make testing a breeze :-) |
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Proposed change
In my original PR (#77626) I assumed all miot based fans would have the problem that the speed level is 3-4 values only instead of percentage. However, this holds only true for the 1c fan. So my previous PR fixed the 1c fan but broke the others.
This PR only handles the 1c fan as an exception and reverts to the previous behavior for the other fans.
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: