Skip to content

Commit

Permalink
Merge pull request #141 from nbogojevic/dev
Browse files Browse the repository at this point in the history
Remove screen switch, new library version, new presets for AC
  • Loading branch information
nbogojevic authored Jan 26, 2024
2 parents dbb62f5 + 762d4a4 commit a9681ae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
20 changes: 15 additions & 5 deletions custom_components/midea_dehumidifier_lan/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
PRESET_ECO,
PRESET_NONE,
PRESET_SLEEP,
PRESET_AWAY,
PRESET_COMFORT,
ClimateEntityFeature,
SWING_BOTH,
SWING_HORIZONTAL,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion custom_components/midea_dehumidifier_lan/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
16 changes: 8 additions & 8 deletions custom_components/midea_dehumidifier_lan/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
Expand Down

0 comments on commit a9681ae

Please sign in to comment.