Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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