mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
deCONZ - Add power attribute for consumption sensors (#25512)
* Add power attribute for consumption sensors * Bump dependency to v62
This commit is contained in:
committed by
Pascal Vizeli
parent
3672a5f881
commit
da53e0a836
@@ -12,6 +12,7 @@ from .deconz_device import DeconzDevice
|
||||
from .gateway import get_gateway_from_config_entry
|
||||
|
||||
ATTR_CURRENT = 'current'
|
||||
ATTR_POWER = 'power'
|
||||
ATTR_DAYLIGHT = 'daylight'
|
||||
ATTR_EVENT_ID = 'event_id'
|
||||
|
||||
@@ -104,6 +105,9 @@ class DeconzSensor(DeconzDevice):
|
||||
attr[ATTR_CURRENT] = self._device.current
|
||||
attr[ATTR_VOLTAGE] = self._device.voltage
|
||||
|
||||
if self.unit_of_measurement == 'kWh':
|
||||
attr[ATTR_POWER] = self._device.power
|
||||
|
||||
if self._device.SENSOR_CLASS == 'daylight':
|
||||
attr[ATTR_DAYLIGHT] = self._device.daylight
|
||||
|
||||
|
||||
Reference in New Issue
Block a user