-
-
Notifications
You must be signed in to change notification settings - Fork 569
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 Xiaomi Airfresh VA2 support #360
Conversation
miio/airfresh.py
Outdated
@@ -0,0 +1,293 @@ | |||
import enum | |||
import logging | |||
import re |
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.
're' imported but unused
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 good to me, added a couple of questions but feel free to merge when you are ready.
miio/airfresh.py
Outdated
try: | ||
return LedBrightness(self.data["led_level"]) | ||
except ValueError: | ||
return None |
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.
Would it be a good idea to log the error here?
@property | ||
def child_lock(self) -> bool: | ||
"""Return True if child lock is on.""" | ||
return self.data["child_lock"] == "on" |
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.
Should this and the other properties also be protected against None?
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 property is always available and doesn't need to be safeguarded.
cp. syssi/xiaomi_airpurifier#25