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: Xiaomi Miio Fan, delay off countdown unit conversion #94428
Conversation
Hey there @rytilahti, @syssi, @starkillerOG, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
AFAIK some miIO devices expect minutes here and others seconds. Because of the inconsistent API / abstraction this isn't trivial to solve unfortunately. |
It looks like the only device that is acting differently is the |
@syssi what if I change it to async def async_set_delay_off_countdown(self, delay_off_countdown: int) -> bool:
"""Set the delay off countdown."""
return await self._try_command(
"Setting delay off miio device failed.",
self._device.delay_off,
delay_off_countdown * 60
if self._model == MODEL_FAN_P5
else delay_off_countdown,
) |
Thanks for looking this up!! In this case we should give it a try! Please mark the change as breaking so the users has a chance to be informed. |
The issue/inconsistency should be fixed at the underlying library (python-miio). We shouldn't introduce workarounds here. |
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.
This is good to go!
I agree,
Done, let me know if you agree with what I wrote. |
Breaking change
The state of
number.<device_name>_delay_off_countdown
was wrongly converted to seconds (multiplied by 60), this change corrects that.Proposed change
Fix bug that Xiaomi Miio Fan, delay off countdown unit conversion is wrong minutes/seconds
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
.To help with the load of incoming pull requests: