Skip to content

Commit

Permalink
[miot air purifier] Return None if aqi is 1 (#930)
Browse files Browse the repository at this point in the history
* Return None if aqi is 1

* Add comment

* Black
  • Loading branch information
bieniu authored Feb 6, 2021
1 parent 5730f53 commit 8e805e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions miio/airpurifier_miot.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def power(self) -> str:
@property
def aqi(self) -> int:
"""Air quality index."""
# zhimi-airpurifier-mb3 returns 1 as AQI value if the measurement was
# unsuccessful
if self.data["aqi"] == 1:
return None
return self.data["aqi"]

@property
Expand Down

0 comments on commit 8e805e3

Please sign in to comment.