Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion homeassistant/components/roomba/irobot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging

from homeassistant.components.vacuum import (
ATTR_STATUS,
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
Expand All @@ -16,6 +17,7 @@
SUPPORT_SEND_COMMAND,
SUPPORT_START,
SUPPORT_STATE,
SUPPORT_STATUS,
SUPPORT_STOP,
StateVacuumEntity,
)
Expand All @@ -40,6 +42,7 @@
| SUPPORT_SEND_COMMAND
| SUPPORT_START
| SUPPORT_STATE
| SUPPORT_STATUS
| SUPPORT_STOP
| SUPPORT_LOCATE
)
Expand Down Expand Up @@ -143,7 +146,7 @@ def state(self):
state = STATE_MAP[phase]
except KeyError:
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
return state

Expand Down Expand Up @@ -173,6 +176,9 @@ def device_state_attributes(self):
# Set properties that are to appear in the GUI
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
# currently on
if self.state == STATE_CLEANING:
Expand Down