Skip to content
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 Qingping Air Monitor Lite support (cgllc.airm.cgdn1) #900

Merged
merged 10 commits into from
Feb 7, 2021
Merged

Add Qingping Air Monitor Lite support (cgllc.airm.cgdn1) #900

merged 10 commits into from
Feb 7, 2021

Conversation

arturdobo
Copy link
Contributor

@arturdobo arturdobo commented Jan 1, 2021

This PR adds support for Qingping Air Monitor Lite support (cgllc.airm.cgdn1).

Specification: https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:air-monitor:0000A008:cgllc-cgdn1:1

Closes: #879

Support start_time and end_time has been intentionally omitted in this PR and can be added in the other one. I didn't check whether the time zone is necessary to compute the current time. If yes, I wasn't able to read time_zone from my device, but cgllc-cgdn1:2 spec mentions that property. What's more Xiaomi Home reads somehow this property from the device.

Another thing is I had no idea what 0 regarding monitoring_frequency could mean.

Copy link
Owner

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Here's a very brief initial review.

miio/airqualitymonitor_miot.py Outdated Show resolved Hide resolved
miio/airqualitymonitor_miot.py Show resolved Hide resolved
miio/airqualitymonitor_miot.py Show resolved Hide resolved
miio/airqualitymonitor_miot.py Show resolved Hide resolved
miio/airqualitymonitor_miot.py Outdated Show resolved Hide resolved
miio/airqualitymonitor_miot.py Show resolved Hide resolved
miio/airqualitymonitor_miot.py Outdated Show resolved Hide resolved
@rytilahti
Copy link
Owner

LGTM, one last thing before merging this, could you add an entry to README's supported devices, @arturdobo?

@arturdobo
Copy link
Contributor Author

@rytilahti updated, but no idea why the build failed

@rytilahti
Copy link
Owner

Looks like a problem at readthedocs' side, could you rebase the README change though? It's conflicting currently with a recently merged PR.

@arturdobo
Copy link
Contributor Author

@rytilahti done

@rytilahti
Copy link
Owner

Great, thanks for the PR! 🎉

The readthedocs problem seems to be related new rust compiler dependency on cryptography lib, which is not available there. I hope that'll get fixed by itself at some point.

@rytilahti rytilahti merged commit 78f8bee into rytilahti:master Feb 7, 2021
@rytilahti rytilahti mentioned this pull request Mar 13, 2021
xvlady pushed a commit to xvlady/python-miio that referenced this pull request May 9, 2021
* Add Qingping Air Monitor Lite support

* add test for cgdn1

* fix typo

* removed CGDN1 from ChargingState enum

* refactored to int be accepted in case of setting monitoring frequency, device off and screen off

* added raw response to the doc string

* moved enums to device class

* fixed typo & exposed options

* removed unnecessary enums from class

* updated readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Any plans on supporting Air Detector Lite PM2.5?
2 participants