From 55bcc707effcd878032bceb34feadb2a03ec2700 Mon Sep 17 00:00:00 2001 From: LiShuzhen Date: Tue, 25 Mar 2025 10:58:33 +0800 Subject: [PATCH] fix: cgllc.airmonitor.s1 unit ppb --- .../xiaomi_home/miot/specs/spec_modify.yaml | 17 ++++++++++------- .../xiaomi_home/miot/specs/specv2entity.py | 6 +++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/custom_components/xiaomi_home/miot/specs/spec_modify.yaml b/custom_components/xiaomi_home/miot/specs/spec_modify.yaml index b37dd71..ae4f603 100644 --- a/custom_components/xiaomi_home/miot/specs/spec_modify.yaml +++ b/custom_components/xiaomi_home/miot/specs/spec_modify.yaml @@ -130,10 +130,13 @@ urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:2: expr: round(src_value/10, 1) urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:1: urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:2 urn:miot-spec-v2:device:plant-monitor:0000A030:hhcc-v1:1: - prop.2.1: - name: soil-moisture - icon: mdi:watering-can - prop.2.2: - name: soil-ec - icon: mdi:sprout-outline - unit: μS/cm + prop.2.1: + name: soil-moisture + icon: mdi:watering-can + prop.2.2: + name: soil-ec + icon: mdi:sprout-outline + unit: μS/cm +urn:miot-spec-v2:device:air-monitor:0000A008:cgllc-s1:1: + prop.2.5: + name: voc-density diff --git a/custom_components/xiaomi_home/miot/specs/specv2entity.py b/custom_components/xiaomi_home/miot/specs/specv2entity.py index 7adbcc6..511dd07 100644 --- a/custom_components/xiaomi_home/miot/specs/specv2entity.py +++ b/custom_components/xiaomi_home/miot/specs/specv2entity.py @@ -506,7 +506,11 @@ SPEC_PROP_TRANS_MAP: dict = { 'entity': 'sensor', 'state_class': SensorStateClass.MEASUREMENT }, - 'voc-density': 'tvoc-density', + 'voc-density': { + 'device_class': SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS, + 'entity': 'sensor', + 'state_class': SensorStateClass.MEASUREMENT + }, 'battery-level': { 'device_class': SensorDeviceClass.BATTERY, 'entity': 'sensor',