diff --git a/custom_components/midea_auto_cloud/__init__.py b/custom_components/midea_auto_cloud/__init__.py index 47cc4d6..98b32bb 100644 --- a/custom_components/midea_auto_cloud/__init__.py +++ b/custom_components/midea_auto_cloud/__init__.py @@ -140,11 +140,6 @@ async def update_listener(hass: HomeAssistant, config_entry: ConfigEntry): async def async_setup(hass: HomeAssistant, config: ConfigType): hass.data.setdefault(DOMAIN, {}) - - # 使用Home Assistant配置目录而不是当前工作目录 - config_dir = hass.config.path(DOMAIN) - os.makedirs(config_dir, exist_ok=True) - os.makedirs(hass.config.path(STORAGE_PATH), exist_ok=True) lua_path = hass.config.path(STORAGE_PATH) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xE2.py b/custom_components/midea_auto_cloud/device_mapping/T0xE2.py index 69e8d32..2f430af 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xE2.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xE2.py @@ -10,10 +10,10 @@ DEVICE_MAPPING = { "queries": [{}], "centralized": [], "entities": { - Platform.WATER_HEATER: { + Platform.CLIMATE: { "water_heater": { "power": "power", - "operation_list": { + "hvac_modes": { "off": {"power": "off"}, "on": {"power": "on"}, }, @@ -26,6 +26,9 @@ DEVICE_MAPPING = { } }, Platform.SWITCH: { + "power": { + "device_class": SwitchDeviceClass.SWITCH, + }, "ti_protect": { "device_class": SwitchDeviceClass.SWITCH, }, diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xE3.py b/custom_components/midea_auto_cloud/device_mapping/T0xE3.py index 0297a3f..393af6e 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xE3.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xE3.py @@ -10,6 +10,9 @@ DEVICE_MAPPING = { "centralized": [], "entities": { Platform.SWITCH: { + "power": { + "device_class": SwitchDeviceClass.SWITCH, + }, "bubble": { "device_class": SwitchDeviceClass.SWITCH, "rationale": [0, 1]