mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fixing 'Unknown' status for Nest Protect devices (#4475)
* Fixing 'Unknown' status for Nest Protect devices * Fixing bad formatting
This commit is contained in:
parent
248f5c0209
commit
6863d2e0af
@ -195,6 +195,7 @@ class NestProtectSensor(NestSensor):
|
|||||||
if self.variable == 'battery_level':
|
if self.variable == 'battery_level':
|
||||||
self._state = getattr(self.device, self.variable)
|
self._state = getattr(self.device, self.variable)
|
||||||
else:
|
else:
|
||||||
|
self._state = 'Unknown'
|
||||||
if state == 0:
|
if state == 0:
|
||||||
self._state = 'Ok'
|
self._state = 'Ok'
|
||||||
if state == 1 or state == 2:
|
if state == 1 or state == 2:
|
||||||
@ -202,8 +203,6 @@ class NestProtectSensor(NestSensor):
|
|||||||
if state == 3:
|
if state == 3:
|
||||||
self._state = 'Emergency'
|
self._state = 'Emergency'
|
||||||
|
|
||||||
self._state = 'Unknown'
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the nest, if any."""
|
"""Return the name of the nest, if any."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user