mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Add color_status sensor for Nest Protect (#14868)
This commit is contained in:
parent
6af995026b
commit
d3d9d9ebf2
@ -17,7 +17,11 @@ SENSOR_TYPES = ['humidity', 'operation_mode', 'hvac_state']
|
|||||||
|
|
||||||
TEMP_SENSOR_TYPES = ['temperature', 'target']
|
TEMP_SENSOR_TYPES = ['temperature', 'target']
|
||||||
|
|
||||||
PROTECT_SENSOR_TYPES = ['co_status', 'smoke_status', 'battery_health']
|
PROTECT_SENSOR_TYPES = ['co_status',
|
||||||
|
'smoke_status',
|
||||||
|
'battery_health',
|
||||||
|
# color_status: "gray", "green", "yellow", "red"
|
||||||
|
'color_status']
|
||||||
|
|
||||||
STRUCTURE_SENSOR_TYPES = ['eta']
|
STRUCTURE_SENSOR_TYPES = ['eta']
|
||||||
|
|
||||||
@ -115,7 +119,8 @@ class NestBasicSensor(NestSensorDevice):
|
|||||||
if self.variable in VARIABLE_NAME_MAPPING:
|
if self.variable in VARIABLE_NAME_MAPPING:
|
||||||
self._state = getattr(self.device,
|
self._state = getattr(self.device,
|
||||||
VARIABLE_NAME_MAPPING[self.variable])
|
VARIABLE_NAME_MAPPING[self.variable])
|
||||||
elif self.variable in PROTECT_SENSOR_TYPES:
|
elif self.variable in PROTECT_SENSOR_TYPES \
|
||||||
|
and self.variable != 'color_status':
|
||||||
# keep backward compatibility
|
# keep backward compatibility
|
||||||
self._state = getattr(self.device, self.variable).capitalize()
|
self._state = getattr(self.device, self.variable).capitalize()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user