Xiaomi Vacuum: keep error state active after erroring (#16562)
* Check for got_error to keep consistent error reporting * reword a commentpull/17276/head
parent
670c75e844
commit
78c38749ab
|
@ -179,6 +179,10 @@ class MiroboVacuum(StateVacuumDevice):
|
|||
def state(self):
|
||||
"""Return the status of the vacuum cleaner."""
|
||||
if self.vacuum_state is not None:
|
||||
# The vacuum reverts back to an idle state after erroring out.
|
||||
# We want to keep returning an error until it has been cleared.
|
||||
if self.vacuum_state.got_error:
|
||||
return STATE_ERROR
|
||||
try:
|
||||
return STATE_CODE_TO_STATE[int(self.vacuum_state.state_code)]
|
||||
except KeyError:
|
||||
|
|
Loading…
Reference in New Issue