From 39932a2d2dcacd7f7e211f65e7ad5f7dbe45802c Mon Sep 17 00:00:00 2001 From: sususweet Date: Wed, 7 Jan 2026 21:04:24 +0800 Subject: [PATCH] feat: update device mapping for T0xE7. Fix #89 --- README.md | 1 + README_hans.md | 1 + .../midea_auto_cloud/device_mapping/T0xE7.py | 50 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 custom_components/midea_auto_cloud/device_mapping/T0xE7.py diff --git a/README.md b/README.md index cc6279b..fe32434 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th - T0xE2 Electric Water Heater - T0xE3 Constant Temperature Gas Water Heater - T0xE6 Wall hanging furnace +- T0xE7 Electric Oven - T0xEA Rice Cooker - T0xED Water Softener - T0xFA Electric Fan diff --git a/README_hans.md b/README_hans.md index 74adc02..dc3a486 100644 --- a/README_hans.md +++ b/README_hans.md @@ -52,6 +52,7 @@ - T0xE2 电热水器 - T0xE3 恒温式燃气热水器 - T0xE6 壁挂炉 +- T0xE7 电磁炉 - T0xEA 电饭锅 - T0xED 软水机 - T0xFA 电风扇 diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xE7.py b/custom_components/midea_auto_cloud/device_mapping/T0xE7.py new file mode 100644 index 0000000..f31d793 --- /dev/null +++ b/custom_components/midea_auto_cloud/device_mapping/T0xE7.py @@ -0,0 +1,50 @@ +from homeassistant.const import Platform, UnitOfTemperature, PRECISION_HALVES +from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass + +DEVICE_MAPPING = { + "default": { + "rationale": ["off", "on"], + "queries": [{}], + "centralized": [], + "entities": { + Platform.NUMBER: { + "temperature": { + "min": 25, + "max": 100, + "step": 1, + }, + "fire_level": { + "min": 120, + "max": 2200, + "step": 1, + }, + "set_work_time": { + "min": 1, + "max": 180, + "step": 1, + }, + }, + Platform.SELECT: { + "work_status": { + "options": { + "standby": {"work_status": "0"}, + "work": {"work_status": "1"}, + "order": {"work_status": "2"}, + "keep_warm": {"work_status": "3"}, + "pause": {"work_status": "4"}, + "power_off": {"work_status": "5"}, + "spare_time": {"work_status": "6"}, + } + }, + }, + Platform.SENSOR: { + "work_mode": { + "device_class": SensorDeviceClass.ENUM, + }, + "work_stage": { + "device_class": SensorDeviceClass.ENUM, + }, + } + } + } +}