mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2025-11-12 07:51:54 +00:00
feat: add support for T0x9C.
This commit is contained in:
@@ -23,6 +23,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th
|
|||||||
- T0x21 Central Air Conditioning Gateway
|
- T0x21 Central Air Conditioning Gateway
|
||||||
- T0x26 Bath Heater
|
- T0x26 Bath Heater
|
||||||
- T0x3D Water Heater
|
- T0x3D Water Heater
|
||||||
|
- T0x9C Integrated Gas Stove
|
||||||
- T0xA1 Dehumidifier
|
- T0xA1 Dehumidifier
|
||||||
- T0xAC Air Conditioner
|
- T0xAC Air Conditioner
|
||||||
- T0xB2 Electric Steamer
|
- T0xB2 Electric Steamer
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
- T0x21 中央空调网关
|
- T0x21 中央空调网关
|
||||||
- T0x26 浴霸
|
- T0x26 浴霸
|
||||||
- T0x3D 电热水瓶
|
- T0x3D 电热水瓶
|
||||||
|
- T0x9C 集成灶
|
||||||
- T0xA1 除湿机
|
- T0xA1 除湿机
|
||||||
- T0xAC 空调
|
- T0xAC 空调
|
||||||
- T0xB2 电蒸箱
|
- T0xB2 电蒸箱
|
||||||
|
|||||||
@@ -87,6 +87,17 @@ class MideaCodec(LuaRuntime):
|
|||||||
query_dict["control"]["bucket"] = prefix
|
query_dict["control"]["bucket"] = prefix
|
||||||
else:
|
else:
|
||||||
query_dict["control"]["bucket"] = "db"
|
query_dict["control"]["bucket"] = "db"
|
||||||
|
# 针对T0x9C集成灶特殊处理
|
||||||
|
elif self._device_type == "T0x9C":
|
||||||
|
control_keys = list(append.keys())
|
||||||
|
if len(control_keys) > 0:
|
||||||
|
# 从第一个键名中提取前缀,例如从 'db_power' 中提取 'db'
|
||||||
|
first_key = control_keys[0]
|
||||||
|
prefix = first_key.split("_")[0]
|
||||||
|
else:
|
||||||
|
prefix = "total"
|
||||||
|
|
||||||
|
query_dict["control"]["type"] = prefix
|
||||||
json_str = json.dumps(query_dict)
|
json_str = json.dumps(query_dict)
|
||||||
MideaLogger.debug(f"LuaRuntime json_str {json_str}")
|
MideaLogger.debug(f"LuaRuntime json_str {json_str}")
|
||||||
try:
|
try:
|
||||||
|
|||||||
86
custom_components/midea_auto_cloud/device_mapping/T0x9C.py
Normal file
86
custom_components/midea_auto_cloud/device_mapping/T0x9C.py
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
from homeassistant.const import Platform, UnitOfTemperature, UnitOfVolume, UnitOfTime, PERCENTAGE, PRECISION_HALVES, \
|
||||||
|
UnitOfEnergy, UnitOfPower, PRECISION_WHOLE, UnitOfPressure
|
||||||
|
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
||||||
|
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||||
|
from homeassistant.components.switch import SwitchDeviceClass
|
||||||
|
|
||||||
|
DEVICE_MAPPING = {
|
||||||
|
"default": {
|
||||||
|
"rationale": ["off", "on"],
|
||||||
|
"queries": [{}],
|
||||||
|
"centralized": ["b6_light"],
|
||||||
|
"entities": {
|
||||||
|
Platform.NUMBER: {
|
||||||
|
"b6_lightness": {
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Platform.SWITCH: {
|
||||||
|
"b6_light": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Platform.SELECT: {
|
||||||
|
"b6_gear": {
|
||||||
|
"options": {
|
||||||
|
"关": {"b6_gear": "0"},
|
||||||
|
"低": {"b6_gear": "1"},
|
||||||
|
"中": {"b6_gear": "2"},
|
||||||
|
"高": {"b6_gear": "3"},
|
||||||
|
"爆炒": {"b6_gear": "4"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b6_power_on_light": {
|
||||||
|
"options": {
|
||||||
|
"关": {"b6_power_on_light": "off", "b6_setting": "power_on_light"},
|
||||||
|
"开": {"b6_power_on_light": "on", "b6_setting": "power_on_light"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b6_lock": {
|
||||||
|
"options": {
|
||||||
|
"关": {"b6_lock": "off", "b6_setting": "lock"},
|
||||||
|
"开": {"b6_lock": "on", "b6_setting": "lock"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b6_smoke_stove_linkage_gear": {
|
||||||
|
"options": {
|
||||||
|
"1档": {"b6_smoke_stove_linkage_gear": 1, "b6_setting": "smoke_stove_linkage"},
|
||||||
|
"2档": {"b6_smoke_stove_linkage_gear": 2, "b6_setting": "smoke_stove_linkage"},
|
||||||
|
"3档": {"b6_smoke_stove_linkage_gear": 3, "b6_setting": "smoke_stove_linkage"},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b6_delay_gear_linkage_gear": {
|
||||||
|
"options": {
|
||||||
|
"1档": {"b6_delay_gear_linkage_gear": 1, "b6_setting": "delay_gear_linkage"},
|
||||||
|
"2档": {"b6_delay_gear_linkage_gear": 2, "b6_setting": "delay_gear_linkage"},
|
||||||
|
"3档": {"b6_delay_gear_linkage_gear": 3, "b6_setting": "delay_gear_linkage"},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b6_delay_time_value": {
|
||||||
|
"options": {
|
||||||
|
"关": {"b6_delay_time": "off", "b6_setting": "delay_time"},
|
||||||
|
"1分钟": {"b6_delay_time": "on", "b6_delay_time_value": 1, "b6_setting": "delay_time"},
|
||||||
|
"2分钟": {"b6_delay_time": "on", "b6_delay_time_value": 2, "b6_setting": "delay_time"},
|
||||||
|
"3分钟": {"b6_delay_time": "on", "b6_delay_time_value": 3, "b6_setting": "delay_time"},
|
||||||
|
"4分钟": {"b6_delay_time": "on", "b6_delay_time_value": 4, "b6_setting": "delay_time"},
|
||||||
|
"5分钟": {"b6_delay_time": "on", "b6_delay_time_value": 5, "b6_setting": "delay_time"},
|
||||||
|
"6分钟": {"b6_delay_time": "on", "b6_delay_time_value": 6, "b6_setting": "delay_time"},
|
||||||
|
"7分钟": {"b6_delay_time": "on", "b6_delay_time_value": 7, "b6_setting": "delay_time"},
|
||||||
|
"8分钟": {"b6_delay_time": "on", "b6_delay_time_value": 8, "b6_setting": "delay_time"},
|
||||||
|
"9分钟": {"b6_delay_time": "on", "b6_delay_time_value": 9, "b6_setting": "delay_time"},
|
||||||
|
"10分钟": {"b6_delay_time": "on", "b6_delay_time_value": 10, "b6_setting": "delay_time"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Platform.SENSOR: {
|
||||||
|
"b6_wind_pressure": {
|
||||||
|
"device_class": SensorDeviceClass.PRESSURE,
|
||||||
|
"unit_of_measurement": UnitOfPressure.PA,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -349,6 +349,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
|
"b6_power": {
|
||||||
|
"name": "Smoke Machine Power"
|
||||||
|
},
|
||||||
|
"b6_power_on_light": {
|
||||||
|
"name": "Smoke Machine Power On Light"
|
||||||
|
},
|
||||||
|
"b6_lock": {
|
||||||
|
"name": "Smoke Machine Lock"
|
||||||
|
},
|
||||||
|
"b6_gear": {
|
||||||
|
"name": "Smoke Machine Gear"
|
||||||
|
},
|
||||||
|
"b6_smoke_stove_linkage_gear": {
|
||||||
|
"name": "Smoke Stove Linkage Gear"
|
||||||
|
},
|
||||||
|
"b6_delay_gear_linkage_gear": {
|
||||||
|
"name": "Smoke Machine Delay Gear Linkage Gear"
|
||||||
|
},
|
||||||
|
"b6_delay_time_value": {
|
||||||
|
"name": "Smoke Machine Delay Time (Minute)"
|
||||||
|
},
|
||||||
"warm_target_temp": {
|
"warm_target_temp": {
|
||||||
"name": "Warm Target Temperature"
|
"name": "Warm Target Temperature"
|
||||||
},
|
},
|
||||||
@@ -1509,12 +1530,20 @@
|
|||||||
"name": "Light"
|
"name": "Light"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"number": {
|
||||||
|
"b6_lightness": {
|
||||||
|
"name": "Smoke Machine Lightness"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fan": {
|
"fan": {
|
||||||
"fan": {
|
"fan": {
|
||||||
"name": "Fan"
|
"name": "Fan"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
"b6_light": {
|
||||||
|
"name": "Smoke Machine Light"
|
||||||
|
},
|
||||||
"temp_wind_switch": {
|
"temp_wind_switch": {
|
||||||
"name": "Wind Change with Temperature"
|
"name": "Wind Change with Temperature"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -353,6 +353,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
|
"b6_power": {
|
||||||
|
"name": "烟机开关"
|
||||||
|
},
|
||||||
|
"b6_power_on_light": {
|
||||||
|
"name": "烟机开机开灯"
|
||||||
|
},
|
||||||
|
"b6_lock": {
|
||||||
|
"name": "烟机锁屏"
|
||||||
|
},
|
||||||
|
"b6_gear": {
|
||||||
|
"name": "烟机档位"
|
||||||
|
},
|
||||||
|
"b6_smoke_stove_linkage_gear": {
|
||||||
|
"name": "烟灶联动档位"
|
||||||
|
},
|
||||||
|
"b6_delay_gear_linkage_gear": {
|
||||||
|
"name": "烟机延时关机风速档位"
|
||||||
|
},
|
||||||
|
"b6_delay_time_value": {
|
||||||
|
"name": "烟机延时关机时间(分钟)"
|
||||||
|
},
|
||||||
"warm_target_temp": {
|
"warm_target_temp": {
|
||||||
"name": "保温目标温度"
|
"name": "保温目标温度"
|
||||||
},
|
},
|
||||||
@@ -1513,12 +1534,20 @@
|
|||||||
"name": "电灯"
|
"name": "电灯"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"number": {
|
||||||
|
"b6_lightness": {
|
||||||
|
"name": "烟机照明"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fan": {
|
"fan": {
|
||||||
"fan": {
|
"fan": {
|
||||||
"name": "风扇"
|
"name": "风扇"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
"b6_light": {
|
||||||
|
"name": "烟机灯"
|
||||||
|
},
|
||||||
"temp_wind_switch": {
|
"temp_wind_switch": {
|
||||||
"name": "风随温变"
|
"name": "风随温变"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user