From 06d6ab6ae650e60f0f53c65ca93d21809cfa940b Mon Sep 17 00:00:00 2001 From: Brandon Chen Date: Mon, 10 Oct 2022 10:08:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8B=20add=20energy=20for=20qmi.plug.2a?= =?UTF-8?q?1c1=20(#826)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaomi_miot/core/device_customizes.py | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index 7a78e182c..243fea0f8 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -519,7 +519,40 @@ 'select_properties': 'mode,rgb_order', 'number_properties': 'numleds,pixel_per_step,fade_delay,step_delay,stair_travel_time', }, - + 'qmi.plug.2a1c1': { + 'main_miot_services': 'switch-2', + 'sensor_attributes': 'power_cost_today,power_cost_month', + 'stat_power_cost_key': '3.1', + }, + 'qmi.plug.2a1c1:electric_power': { + 'unit_of_measurement': 'W', + }, + 'qmi.plug.2a1c1:electric_current': { + 'value_ratio': 0.001, + 'unit_of_measurement': 'A', + }, + 'qmi.plug.2a1c1:voltage': { + 'value_ratio': 0.001, + 'unit_of_measurement': 'V', + }, + 'qmi.plug.2a1c1:power_consumption': { + 'value_ratio': 1, + 'state_class': "total_increasing", + 'device_class': "energy", + 'unit_of_measurement': "kWh", + }, + 'qmi.plug.2a1c1:power_cost_today': { + 'value_ratio': 1, + 'state_class': 'total_increasing', + 'device_class': 'energy', + 'unit_of_measurement': 'kWh', + }, + 'qmi.plug.2a1c1:power_cost_month': { + 'value_ratio': 1, + 'state_class': 'total_increasing', + 'device_class': 'energy', + 'unit_of_measurement': 'kWh', + }, 'qushui.bed.001': { 'chunk_properties': 1, },