Skip to content

Commit 9d3fb33

Browse files
authored
Do not use deprecated depth property (#1124)
* Do not use deprecated depth property * Use local variable
1 parent f76ae70 commit 9d3fb33

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

miio/airhumidifier.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ def water_level(self) -> Optional[int]:
199199
200200
If water tank is full, depth is 125.
201201
"""
202-
if self.depth is not None and self.depth <= 125:
203-
return int(self.depth / 1.25)
202+
depth = self.data.get("depth")
203+
if depth is not None and depth <= 125:
204+
return int(depth / 1.25)
204205
return None
205206

206207
@property

0 commit comments

Comments
 (0)