mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix roomba not reporting error (#34996)
This commit is contained in:
parent
bb08959131
commit
225059f8ea
@ -3,6 +3,7 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.vacuum import (
|
from homeassistant.components.vacuum import (
|
||||||
|
ATTR_STATUS,
|
||||||
STATE_CLEANING,
|
STATE_CLEANING,
|
||||||
STATE_DOCKED,
|
STATE_DOCKED,
|
||||||
STATE_ERROR,
|
STATE_ERROR,
|
||||||
@ -16,6 +17,7 @@ from homeassistant.components.vacuum import (
|
|||||||
SUPPORT_SEND_COMMAND,
|
SUPPORT_SEND_COMMAND,
|
||||||
SUPPORT_START,
|
SUPPORT_START,
|
||||||
SUPPORT_STATE,
|
SUPPORT_STATE,
|
||||||
|
SUPPORT_STATUS,
|
||||||
SUPPORT_STOP,
|
SUPPORT_STOP,
|
||||||
StateVacuumEntity,
|
StateVacuumEntity,
|
||||||
)
|
)
|
||||||
@ -40,6 +42,7 @@ SUPPORT_IROBOT = (
|
|||||||
| SUPPORT_SEND_COMMAND
|
| SUPPORT_SEND_COMMAND
|
||||||
| SUPPORT_START
|
| SUPPORT_START
|
||||||
| SUPPORT_STATE
|
| SUPPORT_STATE
|
||||||
|
| SUPPORT_STATUS
|
||||||
| SUPPORT_STOP
|
| SUPPORT_STOP
|
||||||
| SUPPORT_LOCATE
|
| SUPPORT_LOCATE
|
||||||
)
|
)
|
||||||
@ -143,7 +146,7 @@ class IRobotVacuum(IRobotEntity, StateVacuumEntity):
|
|||||||
state = STATE_MAP[phase]
|
state = STATE_MAP[phase]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return STATE_ERROR
|
return STATE_ERROR
|
||||||
if cycle != "none" and state != STATE_CLEANING and state != STATE_RETURNING:
|
if cycle != "none" and (state == STATE_IDLE or state == STATE_DOCKED):
|
||||||
state = STATE_PAUSED
|
state = STATE_PAUSED
|
||||||
return state
|
return state
|
||||||
|
|
||||||
@ -173,6 +176,9 @@ class IRobotVacuum(IRobotEntity, StateVacuumEntity):
|
|||||||
# Set properties that are to appear in the GUI
|
# Set properties that are to appear in the GUI
|
||||||
state_attrs = {ATTR_SOFTWARE_VERSION: software_version}
|
state_attrs = {ATTR_SOFTWARE_VERSION: software_version}
|
||||||
|
|
||||||
|
# Set legacy status to avoid break changes
|
||||||
|
state_attrs[ATTR_STATUS] = self.vacuum.current_state
|
||||||
|
|
||||||
# Only add cleaning time and cleaned area attrs when the vacuum is
|
# Only add cleaning time and cleaned area attrs when the vacuum is
|
||||||
# currently on
|
# currently on
|
||||||
if self.state == STATE_CLEANING:
|
if self.state == STATE_CLEANING:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user