From 17a684ffe7b38c2f943fef444f61deef26732f88 Mon Sep 17 00:00:00 2001 From: Alone Date: Thu, 14 Mar 2024 17:23:59 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20add=20sub-entities=20for=20iot.swit?= =?UTF-8?q?ch.padwb1=20(#1566)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaomi_miot/core/device_customizes.py | 23 +++++++++++++++++++ .../xiaomi_miot/core/miot_local_devices.py | 1 + 2 files changed, 24 insertions(+) diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index f61d660224..69333ab9a5 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -692,6 +692,29 @@ 'device_class': 'energy', 'unit_of_measurement': 'kWh', }, + 'iot.switch.padwb1': { + 'sensor_properties': 'a_electric_current,a_power,a_voltage,a_temp,a_fault,' + 'b_electric_current,b_power,b_voltage,b_temp,b_fault,' + 'c_electric_current,c_power,c_voltage,c_temp,c_fault', + 'select_properties': 'default_power_on_state', + 'switch_properties': 'self_check,leak_switch,voice_switch', + 'number_properties': 'over_electric_set,lack_voltage_set,delay_set,close_temp_set,over_voltage_set,alert_temp_set', + 'stat_power_cost_type': 'stat_day_v3', + 'stat_power_cost_key': '3.1', + 'sensor_attributes': 'power_cost_today,power_cost_month', + }, + 'iot.switch.padwb1:power_cost_today': { + 'value_ratio': 1, + 'state_class': 'total_increasing', + 'device_class': 'energy', + 'unit_of_measurement': 'kWh', + }, + 'iot.switch.padwb1:power_cost_month': { + 'value_ratio': 1, + 'state_class': 'total_increasing', + 'device_class': 'energy', + 'unit_of_measurement': 'kWh', + }, 'isa.camera.hlc7': { 'select_properties': 'night_shot,recording_mode,detection_sensitivity', 'switch_properties': 'on,time_watermark,motion_detection', diff --git a/custom_components/xiaomi_miot/core/miot_local_devices.py b/custom_components/xiaomi_miot/core/miot_local_devices.py index 6f83b97870..9ca56134c0 100644 --- a/custom_components/xiaomi_miot/core/miot_local_devices.py +++ b/custom_components/xiaomi_miot/core/miot_local_devices.py @@ -285,6 +285,7 @@ 'ijomoo.toilet.zs320', 'iot.plug.socn1', 'iot.switch.padw2p', + 'iot.switch.padwb1', 'isa.camera.hlc7', 'isa.camera.hlc8', 'isa.camera.hlc9a',