Skip to content

Commit

Permalink
Do not use deprecated depth property (#1124)
Browse files Browse the repository at this point in the history
* Do not use deprecated depth property

* Use local variable
  • Loading branch information
bieniu committed Aug 31, 2021
1 parent f76ae70 commit 9d3fb33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions miio/airhumidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ def water_level(self) -> Optional[int]:
If water tank is full, depth is 125.
"""
if self.depth is not None and self.depth <= 125:
return int(self.depth / 1.25)
depth = self.data.get("depth")
if depth is not None and depth <= 125:
return int(depth / 1.25)
return None

@property
Expand Down

0 comments on commit 9d3fb33

Please sign in to comment.