-
-
Notifications
You must be signed in to change notification settings - Fork 558
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 Smartmi Air Purifier (zhimi.airpurifier.za1) #1417
Add support for Smartmi Air Purifier (zhimi.airpurifier.za1) #1417
Conversation
I don't know what unit the TVOC value is, it seems to go from 0..500 in 1 steps according to the spec. There's a bunch more attributes like max. filter time, when the filter door was last opened, or how long the purifier has been sued that I did not bother adding as they do not seem all that useful. |
1fd7832
to
e9d9270
Compare
flake8 failure seems unrelated flake8 issue, should be fixed in master first and I guess then rebase the PR. I still see: WARNING:miio.device:Found an unsupported model 'zhimi.airpurifier.za1' for class 'AirPurifierMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/ But I'm not sure where else to put that string to get it to be recognized. |
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 after fixing the exception message, the flake8 error is now fixed in master so rebasing the PR on it should fix the build! The warning you are still receiving feels odd as the keys from mappings dictionary are used to check whether the device is listed as supported or not..
This also adds a tvoc attribute. Fixes rytilahti#1025
faef2bc
to
7a22804
Compare
Codecov Report
@@ Coverage Diff @@
## master #1417 +/- ##
==========================================
- Coverage 84.30% 84.27% -0.04%
==========================================
Files 135 135
Lines 13401 13413 +12
Branches 3204 3209 +5
==========================================
+ Hits 11298 11304 +6
- Misses 1886 1891 +5
- Partials 217 218 +1
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
I'm also confused about the warning. It happens with a clean-ish docker container running a tiny python script, so hmm (e9d9270 being the previous head of the branch).
Running this yields
Not sure what else would be missing to drop this, but it works fine otherwise. And for really unsupported models one would additionally get:
|
Co-authored-by: Teemu R. <tpr@iki.fi>
7a22804
to
2241757
Compare
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, let's get this into the next release, thanks @julian-klode! 👍
Add support for zhimi.airpurifier.za1
This also adds a tvoc attribute, and the gesture control setting in a 2nd commit.
Fixes #1025