From 6863d2e0afebee7f8279acddb3f30e4ca15b0b29 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Mon, 21 Nov 2016 20:39:23 -0700 Subject: [PATCH] Fixing 'Unknown' status for Nest Protect devices (#4475) * Fixing 'Unknown' status for Nest Protect devices * Fixing bad formatting --- homeassistant/components/sensor/nest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/nest.py b/homeassistant/components/sensor/nest.py index ccf8be84adc..9f8e7396f93 100644 --- a/homeassistant/components/sensor/nest.py +++ b/homeassistant/components/sensor/nest.py @@ -195,6 +195,7 @@ class NestProtectSensor(NestSensor): if self.variable == 'battery_level': self._state = getattr(self.device, self.variable) else: + self._state = 'Unknown' if state == 0: self._state = 'Ok' if state == 1 or state == 2: @@ -202,8 +203,6 @@ class NestProtectSensor(NestSensor): if state == 3: self._state = 'Emergency' - self._state = 'Unknown' - @property def name(self): """Return the name of the nest, if any."""