Skip to content

Commit

Permalink
Avoid crash if vaccum doesn't support water box
Browse files Browse the repository at this point in the history
Co-Authored-By: Teemu R. <tpr@iki.fi>
  • Loading branch information
ckesc and rytilahti authored Apr 19, 2020
1 parent ee53c02 commit 8ac2e3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion miio/vacuumcontainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def is_on(self) -> bool:
@property
def is_water_box_attached(self) -> int:
"""Return True is water box is installed."""
return self.data["water_box_status"] == 1
return "water_box_status" in self.data and self.data["water_box_status"] == 1

@property
def got_error(self) -> bool:
Expand Down

0 comments on commit 8ac2e3a

Please # to comment.