diff --git a/custom_components/midea_dehumidifier_lan/climate.py b/custom_components/midea_dehumidifier_lan/climate.py index e1776e7..d160295 100644 --- a/custom_components/midea_dehumidifier_lan/climate.py +++ b/custom_components/midea_dehumidifier_lan/climate.py @@ -16,6 +16,8 @@ PRESET_ECO, PRESET_NONE, PRESET_SLEEP, + PRESET_AWAY, + PRESET_COMFORT, ClimateEntityFeature, SWING_BOTH, SWING_HORIZONTAL, @@ -65,7 +67,7 @@ SWING_MODES: Final = [SWING_OFF, SWING_HORIZONTAL, SWING_VERTICAL, SWING_BOTH] -PRESET_MODES: Final = [PRESET_NONE, PRESET_ECO, PRESET_BOOST, PRESET_SLEEP] +PRESET_MODES: Final = [PRESET_NONE, PRESET_ECO, PRESET_BOOST, PRESET_SLEEP, PRESET_AWAY, PRESET_COMFORT] _FAN_SPEEDS = { FAN_AUTO: 102, @@ -162,6 +164,10 @@ def _preset_mode(self) -> str: return PRESET_ECO if self.airconditioner().comfort_sleep: return PRESET_SLEEP + if self.airconditioner().frost_protect: + return PRESET_AWAY + if self.airconditioner().comfort_mode: + return PRESET_COMFORT return PRESET_NONE def _swing_mode(self) -> str: @@ -233,10 +239,14 @@ def set_fan_mode(self, fan_mode: str) -> None: def set_preset_mode(self, preset_mode: str) -> None: if preset_mode == PRESET_BOOST: - self.apply(turbo=True, eco_mode=False, comfort_sleep=False) + self.apply(turbo=True, eco_mode=False, comfort_sleep=False, frost_protect=False, comfort_mode=False) elif preset_mode == PRESET_ECO: - self.apply(turbo=False, eco_mode=True, comfort_sleep=False) + self.apply(turbo=False, eco_mode=True, comfort_sleep=False, frost_protect=False, comfort_mode=False) elif preset_mode == PRESET_SLEEP: - self.apply(turbo=False, eco_mode=False, comfort_sleep=True) + self.apply(turbo=False, eco_mode=False, comfort_sleep=True, frost_protect=False, comfort_mode=False) + elif preset_mode == PRESET_AWAY: + self.apply(turbo=False, eco_mode=False, comfort_sleep=False, frost_protect=True, comfort_mode=False) + elif preset_mode == PRESET_SLEEP: + self.apply(turbo=False, eco_mode=False, comfort_sleep=False, frost_protect=False, comfort_mode=True) else: - self.apply(turbo=False, eco_mode=False, comfort_sleep=False) + self.apply(turbo=False, eco_mode=False, comfort_sleep=False, frost_protect=False, comfort_mode=False) diff --git a/custom_components/midea_dehumidifier_lan/manifest.json b/custom_components/midea_dehumidifier_lan/manifest.json index 3cd7caf..07eefc2 100644 --- a/custom_components/midea_dehumidifier_lan/manifest.json +++ b/custom_components/midea_dehumidifier_lan/manifest.json @@ -13,7 +13,7 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues", "requirements": [ - "midea-beautiful-air==0.10.0" + "midea-beautiful-air==0.10.4" ], "version": "0.9.0" } \ No newline at end of file diff --git a/custom_components/midea_dehumidifier_lan/switch.py b/custom_components/midea_dehumidifier_lan/switch.py index b16b1be..fcb9876 100644 --- a/custom_components/midea_dehumidifier_lan/switch.py +++ b/custom_components/midea_dehumidifier_lan/switch.py @@ -102,18 +102,18 @@ class _MideaSwitchDescriptor: capability="strong_fan", prefix=UNIQUE_CLIMATE_PREFIX, ) -SCREEN_SWITCH: Final = _MideaSwitchDescriptor( - attr="show_screen", - name="Show Screen", - icon="mdi:clock-digital", - capability="screen_display", - prefix=UNIQUE_CLIMATE_PREFIX, -) +# SCREEN_SWITCH: Final = _MideaSwitchDescriptor( +# attr="show_screen", +# name="Show Screen", +# icon="mdi:clock-digital", +# capability="screen_display", +# prefix=UNIQUE_CLIMATE_PREFIX, +# ) CLIMATE_SWITCHES: Final = [ CLIMATE_BEEP_SWITCH, DRYER_SWITCH, FAHRENHEIT_SWITCH, - SCREEN_SWITCH, + # SCREEN_SWITCH, PURIFIER_SWITCH, TURBO_FAN_SWITCH, ]