mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Xiaomi Vacuum: keep error state active after erroring (#16562)
* Check for got_error to keep consistent error reporting * reword a comment
This commit is contained in:
parent
670c75e844
commit
78c38749ab
@ -179,6 +179,10 @@ class MiroboVacuum(StateVacuumDevice):
|
|||||||
def state(self):
|
def state(self):
|
||||||
"""Return the status of the vacuum cleaner."""
|
"""Return the status of the vacuum cleaner."""
|
||||||
if self.vacuum_state is not None:
|
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:
|
try:
|
||||||
return STATE_CODE_TO_STATE[int(self.vacuum_state.state_code)]
|
return STATE_CODE_TO_STATE[int(self.vacuum_state.state_code)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user