Fix for Neato D3 Connected state obtaining (#8817)

This commit is contained in:
karlkar 2017-08-09 23:22:08 +02:00 committed by Martin Hjelmare
parent 55c84eaee3
commit b035577cf5
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ class NeatoConnectedSensor(Entity):
self._status_state = ERRORS.get(self._state['error'])
if self.type == SENSOR_TYPE_BATTERY:
self._battery_state = self._state['details']['charge']
if self._mapdata is None:
if not self._mapdata.get(self.robot.serial, {}).get('maps', []):
return
self.clean_time_start = (
(self._mapdata[self.robot.serial]['maps'][0]['start_at']

View File

@ -72,7 +72,7 @@ class NeatoConnectedSwitch(ToggleEntity):
self._clean_state = STATE_ON
else:
self._clean_state = STATE_OFF
_LOGGER.debug("Schedule state: %s", self._schedule_state)
_LOGGER.debug("Clean state: %s", self._clean_state)
if self.type == SWITCH_TYPE_SCHEDULE:
_LOGGER.debug("State: %s", self._state)
if self.robot.schedule_enabled: