Skip to content

Commit

Permalink
Add Xiaomi Air Quality Monitor 2gen (cgllc.airmonitor.b1) support (Cl…
Browse files Browse the repository at this point in the history
…oses: #419)
  • Loading branch information
syssi committed Nov 22, 2018
1 parent 13bad32 commit d52917f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion miio/airqualitymonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ class AirQualityMonitorStatus:
"""Container of air quality monitor status."""

def __init__(self, data):
# {'power': 'on', 'aqi': 34, 'battery': 100, 'usb_state': 'off', 'time_state': 'on'}
"""
Response of a Xiaomi Air Quality Monitor (zhimi.airmonitor.v1):
{'power': 'on', 'aqi': 34, 'battery': 100, 'usb_state': 'off', 'time_state': 'on'}
Response of a Xiaomi Air Quality Monitor (cgllc.airmonitor.b1):
unknown.
"""
self.data = data

@property
Expand Down
1 change: 1 addition & 0 deletions miio/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"zhimi-fan-za1": partial(Fan, model=MODEL_FAN_ZA1),
"zhimi-airfresh-va2": AirFresh,
"zhimi-airmonitor-v1": AirQualityMonitor,
"cgllc-airmonitor-b1": AirQualityMonitor,
"lumi-gateway-": lambda x: other_package_info(
x, "https://github.com/Danielhiversen/PyXiaomiGateway")
} # type: Dict[str, Union[Callable, Device]]
Expand Down

0 comments on commit d52917f

Please sign in to comment.