From 1ef8fdc42aefceb4f98581cf6f0aa41109a5823e Mon Sep 17 00:00:00 2001 From: LiShuzhen Date: Fri, 21 Mar 2025 09:18:04 +0800 Subject: [PATCH] fix: chuangmi.plug.212a01 power consumption value --- custom_components/xiaomi_home/miot/specs/spec_modify.yaml | 5 +++++ custom_components/xiaomi_home/miot/specs/specv2entity.py | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/custom_components/xiaomi_home/miot/specs/spec_modify.yaml b/custom_components/xiaomi_home/miot/specs/spec_modify.yaml index cea86fb..fd35c03 100644 --- a/custom_components/xiaomi_home/miot/specs/spec_modify.yaml +++ b/custom_components/xiaomi_home/miot/specs/spec_modify.yaml @@ -116,3 +116,8 @@ urn:miot-spec-v2:device:thermostat:0000A031:suittc-wk168:1: description: fifteen - value: 16 description: sixteen +urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3: + prop.5.1: + expr: round(src_value*6/1000000, 3) +urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:1: urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3 +urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:2: urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3 diff --git a/custom_components/xiaomi_home/miot/specs/specv2entity.py b/custom_components/xiaomi_home/miot/specs/specv2entity.py index 12ce798..7adbcc6 100644 --- a/custom_components/xiaomi_home/miot/specs/specv2entity.py +++ b/custom_components/xiaomi_home/miot/specs/specv2entity.py @@ -560,12 +560,6 @@ SPEC_PROP_TRANS_MAP: dict = { 'entity': 'sensor', 'state_class': SensorStateClass.MEASUREMENT, 'unit_of_measurement': UnitOfPower.WATT - }, - 'total-battery': { - 'device_class': SensorDeviceClass.ENERGY, - 'entity': 'sensor', - 'state_class': SensorStateClass.TOTAL_INCREASING, - 'unit_of_measurement': UnitOfEnergy.KILO_WATT_HOUR } } }