From b035577cf51ad63df073ccc593cb410e931923a9 Mon Sep 17 00:00:00 2001 From: karlkar Date: Wed, 9 Aug 2017 23:22:08 +0200 Subject: [PATCH] Fix for Neato D3 Connected state obtaining (#8817) --- homeassistant/components/sensor/neato.py | 2 +- homeassistant/components/switch/neato.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/neato.py b/homeassistant/components/sensor/neato.py index eb1524e1748..5179816eb35 100644 --- a/homeassistant/components/sensor/neato.py +++ b/homeassistant/components/sensor/neato.py @@ -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'] diff --git a/homeassistant/components/switch/neato.py b/homeassistant/components/switch/neato.py index 739e4e03fed..f29dc31eaf0 100644 --- a/homeassistant/components/switch/neato.py +++ b/homeassistant/components/switch/neato.py @@ -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: