mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Add support for deCONZ daylight sensor (#13479)
* Add support for deCONZ daylight sensor Bump pydeconz to 34 * Remove 'daylight' reason from async u
This commit is contained in:
parent
3906250c9e
commit
d3b261a25d
@ -16,6 +16,7 @@ from homeassistant.util import slugify
|
|||||||
DEPENDENCIES = ['deconz']
|
DEPENDENCIES = ['deconz']
|
||||||
|
|
||||||
ATTR_CURRENT = 'current'
|
ATTR_CURRENT = 'current'
|
||||||
|
ATTR_DAYLIGHT = 'daylight'
|
||||||
ATTR_EVENT_ID = 'event_id'
|
ATTR_EVENT_ID = 'event_id'
|
||||||
|
|
||||||
|
|
||||||
@ -113,6 +114,8 @@ class DeconzSensor(Entity):
|
|||||||
if self.unit_of_measurement == 'Watts':
|
if self.unit_of_measurement == 'Watts':
|
||||||
attr[ATTR_CURRENT] = self._sensor.current
|
attr[ATTR_CURRENT] = self._sensor.current
|
||||||
attr[ATTR_VOLTAGE] = self._sensor.voltage
|
attr[ATTR_VOLTAGE] = self._sensor.voltage
|
||||||
|
if self._sensor.sensor_class == 'daylight':
|
||||||
|
attr[ATTR_DAYLIGHT] = self._sensor.daylight
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user