diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py index a23c872..eb8ee4e 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py @@ -1,3 +1,4 @@ +from homeassistant.components.playstation_network.media_player import PLATFORM_MAP from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass from homeassistant.const import Platform, UnitOfPower, UnitOfElectricPotential from homeassistant.components.switch import SwitchDeviceClass @@ -6,7 +7,7 @@ DEVICE_MAPPING = { "default": { "rationale": ["off", "on"], "queries": [{}], - "centralized": [], + "centralized": ["lightness"], "calculate": { "get": [ { @@ -28,9 +29,6 @@ DEVICE_MAPPING = { } }, Platform.SENSOR: { - "error_code": { - "device_class": SensorDeviceClass.ENUM - }, "b7_left_status": { "device_class": SensorDeviceClass.ENUM, "translation_key": "left_status", @@ -46,6 +44,28 @@ DEVICE_MAPPING = { "translation_key": "battery_voltage", } }, + Platform.BUTTON: { + "light_off": { + "command": {"electronic_control_version": 2, "type": "b6", "b6_action": "setting", + "setting": "light", "light": "off"}, + }, + "light_on": { + "command": {"electronic_control_version": 2, "type": "b6", "b6_action": "setting", + "setting": "light", "light": "on"}, + }, + "left_stove_off": { + "command": {"electronic_control_version": 2, "type": "b7", "b7_work_burner_control": 1, + "b7_function_control": 1}, + }, + "right_stove_off": { + "command": {"electronic_control_version": 2, "type": "b7", "b7_work_burner_control": 2, + "b7_function_control": 1}, + }, + "middle_stove_off": { + "command": {"electronic_control_version": 2, "type": "b7", "b7_work_burner_control": 3, + "b7_function_control": 1}, + } + }, Platform.SELECT: { "wind_pressure": { "options": { diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index 219a392..3aab8f5 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -122,6 +122,23 @@ } }, "entity": { + "button": { + "light_off": { + "name": "Light off" + }, + "light_on": { + "name": "Light on" + }, + "left_stove_off": { + "name": "Left stove off" + }, + "right_stove_off": { + "name": "Right stove off" + }, + "middle_stove_off": { + "name": "Middle stove off" + } + }, "binary_sensor": { "heating_work": { "name": "Heating Work Status" @@ -2775,6 +2792,9 @@ "endpoint_8_onoff": { "name": "Button 8" }, + "wisdom_wind": { + "name": "Wisdom Wind" + }, "work_switch": { "name": "Work Switch" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index ac5b442..cccfd34 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -122,6 +122,23 @@ } }, "entity": { + "button": { + "light_off": { + "name": "关闭灯光" + }, + "light_on": { + "name": "打开灯光" + }, + "left_stove_off": { + "name": "左灶关火" + }, + "right_stove_off": { + "name": "右灶关火" + }, + "middle_stove_off": { + "name": "中灶关火" + } + }, "binary_sensor": { "heating_work": { "name": "采暖功能状态" @@ -2870,6 +2887,9 @@ "endpoint_8_onoff": { "name": "按键八" }, + "wisdom_wind": { + "name": "智能风" + }, "work_switch": { "name": "工作开关" },