deCONZ - Add power attribute for consumption sensors (#25512)
* Add power attribute for consumption sensors * Bump dependency to v62
This commit is contained in:
1 parent
3672a5f881
commit
da53e0a836
5 files changed
+15
-4
No files matched your search
@@ -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