From 9f6cf15763b04fb38fbf888ee6fe58eda05b5e6e Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 16 Jan 2026 21:43:46 +0800 Subject: [PATCH] fix: support of wind_pressure sensor for T0xB6(730007H8) * also update translation_key --- .../midea_auto_cloud/device_mapping/T0xB6.py | 8 +++++++- custom_components/midea_auto_cloud/translations/en.json | 6 ++++++ .../midea_auto_cloud/translations/zh-Hans.json | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py index 0ed56b0..e4a4ad1 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py @@ -1,5 +1,5 @@ from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass -from homeassistant.const import Platform, PERCENTAGE, UnitOfTime, UnitOfElectricPotential +from homeassistant.const import Platform, PERCENTAGE, UnitOfPressure, UnitOfTime, UnitOfElectricPotential from homeassistant.components.switch import SwitchDeviceClass DEVICE_MAPPING = { @@ -137,6 +137,12 @@ DEVICE_MAPPING = { "device_class": SensorDeviceClass.ENERGY, "unit_of_measurement": "kWh", "state_class": SensorStateClass.TOTAL_INCREASING, + "translation_key": "total_elec_value" + }, + "wind_pressure": { + "device_class": SensorDeviceClass.PRESSURE, + "unit_of_measurement": UnitOfPressure.PA, + "state_class": SensorStateClass.MEASUREMENT } }, Platform.BUTTON: { diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index b58da72..d809f64 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -1098,6 +1098,12 @@ } }, "sensor": { + "total_working_time": { + "name": "Total Working Time" + }, + "wind_pressure": { + "name": "Wind Pressure" + }, "tips_code": { "name": "Tips Code" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 2ca84a3..937ffaf 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -1334,6 +1334,12 @@ } }, "sensor": { + "total_working_time": { + "name": "累计工作时间" + }, + "wind_pressure": { + "name": "风压" + }, "tips_code": { "name": "提示代码" },