Skip to content

Commit

Permalink
Add explanation why we adjust the update duration for mb3
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Jan 7, 2022
1 parent 5a13784 commit 3e94c6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion miio/airpurifier_miot.py
Expand Up @@ -46,7 +46,7 @@
# AQI (siid=13)
"purify_volume": {"siid": 13, "piid": 1},
"average_aqi": {"siid": 13, "piid": 2},
"aqi_realtime_update_duration": {"siid": 13, "piid": 9}, # see #1281
"aqi_realtime_update_duration": {"siid": 13, "piid": 9},
# RFID (siid=14)
"filter_rfid_tag": {"siid": 14, "piid": 1},
"filter_rfid_product_id": {"siid": 14, "piid": 3},
Expand Down Expand Up @@ -402,6 +402,9 @@ class AirPurifierMiot(BasicAirPurifierMiot):
)
def status(self) -> AirPurifierMiotStatus:
"""Retrieve properties."""
# Some devices update the aqi information only every 30min.
# This forces the device to poll the sensor for 5 seconds,
# so that we get always the most recent values. See #1281.
if self.model == "zhimi.airpurifier.mb3":
self.set_property("aqi_realtime_update_duration", 5)

Expand Down

0 comments on commit 3e94c6d

Please sign in to comment.