-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Add support for zhimi.heater.mc2 #895
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.
Looks fairly straightforward to me, only a minor change needed before this can be merged. Thanks for the PR!
miio/heater_miot.py
Outdated
|
||
@property | ||
def countdown_time(self) -> int: | ||
"""Countdown time.""" |
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.
What does this indicate? Time until the device gets turned off? Maybe the property naming should follow the same format as in heater?
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.
Exactly. The countdown_time
field defines the number hours before the device goes off.
The problem here is that the spec defines this field as countdown_time
while for miio heater it is delay_off_countdown
. Shall I overwrite countdown_time
to match the field name in heater (delay_off_countdown
)?
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.
Okay, looking at the current code base, there are several instances of delay_off_countdown
which returns the value in seconds.
So I'd say yes, it's better use that same naming scheme (and return the value in seconds even when the precision is much lower) just to be consistent.
@rytilahti fixed according to your comments. let me know if I missed anything |
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.
One last very minor change and this is good to go. Thanks for the PR! 🥇
This is great! Thanks! |
* Add support for zhimi.heater.mc2 * fixup! Fix docstring for HeaterMiot * fixup! Add zhimi.heater.mc2 to readme * fixup! Fix miot spec link * fixup! Add response example for heater * fixup! Rename brightness property of miot heater * fixup! Allow setting delay countdown in seconds * Add model info to docstring Co-authored-by: Teemu R <[email protected]>
This PR adds support for Xiaomi Mi Smart Space Heater S (zhimi.heater.mc2).
References: #880
miot spec: https://miot-spec.org/miot-spec-v2/instance\?type\=urn:miot-spec-v2:device:heater:0000A01A:zhimi-mc2:1
Details
Product:Mi Home UI:
Added unit tests as well as tested the new heater module on an actual device.
Please let me know if I missed anything.