Skip to content

Commit b464727

Browse files
authored
vacuum's got_error: compare against error code, not against the state (#379)
Breaking change. `got_error` returns now True even after the state has been changed (e.g. the vacuum went to idle) but the error is still present.
1 parent 11ea2a0 commit b464727

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

miio/vacuumcontainers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def is_on(self) -> bool:
139139
@property
140140
def got_error(self) -> bool:
141141
"""True if an error has occured."""
142-
return self.state_code == 12
142+
return self.error_code != 0
143143

144144
def __repr__(self) -> str:
145145
s = "<VacuumStatus state=%s, error=%s " % (self.state, self.error)

0 commit comments

Comments
 (0)