From 90accce86bf0097ce0247e450ec8f5632f43be88 Mon Sep 17 00:00:00 2001 From: juzi Date: Sat, 4 Jan 2025 17:07:29 +0800 Subject: [PATCH] feat: add power properties trans --- custom_components/xiaomi_home/miot/specs/specv2entity.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom_components/xiaomi_home/miot/specs/specv2entity.py b/custom_components/xiaomi_home/miot/specs/specv2entity.py index 9763970b..8a6a823f 100644 --- a/custom_components/xiaomi_home/miot/specs/specv2entity.py +++ b/custom_components/xiaomi_home/miot/specs/specv2entity.py @@ -431,6 +431,14 @@ 'unit_of_measurement': UnitOfEnergy.KILO_WATT_HOUR } }, + 'power': { + 'device_class': SensorDeviceClass.POWER, + 'entity': 'sensor', + 'optional': { + 'state_class': SensorStateClass.MEASUREMENT, + 'unit_of_measurement': UnitOfPower.WATT + } + }, 'total-battery': { 'device_class': SensorDeviceClass.ENERGY, 'entity': 'sensor',