mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use cached states for neato when possible (#15218)
This commit is contained in:
parent
56f17b8651
commit
2524dca7bf
@ -67,7 +67,7 @@ class NeatoConnectedSwitch(ToggleEntity):
|
|||||||
_LOGGER.debug('self._state=%s', self._state)
|
_LOGGER.debug('self._state=%s', self._state)
|
||||||
if self.type == SWITCH_TYPE_SCHEDULE:
|
if self.type == SWITCH_TYPE_SCHEDULE:
|
||||||
_LOGGER.debug("State: %s", self._state)
|
_LOGGER.debug("State: %s", self._state)
|
||||||
if self.robot.schedule_enabled:
|
if self._state['details']['isScheduleEnabled']:
|
||||||
self._schedule_state = STATE_ON
|
self._schedule_state = STATE_ON
|
||||||
else:
|
else:
|
||||||
self._schedule_state = STATE_OFF
|
self._schedule_state = STATE_OFF
|
||||||
|
@ -96,14 +96,14 @@ class NeatoConnectedVacuum(VacuumDevice):
|
|||||||
elif self._state['state'] == 4:
|
elif self._state['state'] == 4:
|
||||||
self._status_state = ERRORS.get(self._state['error'])
|
self._status_state = ERRORS.get(self._state['error'])
|
||||||
|
|
||||||
if (self.robot.state['action'] == 1 or
|
if (self._state['action'] == 1 or
|
||||||
self.robot.state['action'] == 2 or
|
self._state['action'] == 2 or
|
||||||
self.robot.state['action'] == 3 and
|
self._state['action'] == 3 and
|
||||||
self.robot.state['state'] == 2):
|
self._state['state'] == 2):
|
||||||
self._clean_state = STATE_ON
|
self._clean_state = STATE_ON
|
||||||
elif (self.robot.state['action'] == 11 or
|
elif (self._state['action'] == 11 or
|
||||||
self.robot.state['action'] == 12 and
|
self._state['action'] == 12 and
|
||||||
self.robot.state['state'] == 2):
|
self._state['state'] == 2):
|
||||||
self._clean_state = STATE_ON
|
self._clean_state = STATE_ON
|
||||||
else:
|
else:
|
||||||
self._clean_state = STATE_OFF
|
self._clean_state = STATE_OFF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user