Skip to content

Commit b6b8dba

Browse files
Merge pull request #188 from hristo-atanasov/ELECTRA_AC-tweak-fix
Electra ac tweak fix
2 parents 88eff76 + 2b314b9 commit b6b8dba

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

custom_components/tasmota_irhvac/climate.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
FAN_AUTO,
3131
FAN_DIFFUSE,
3232
FAN_FOCUS,
33+
FAN_TOP,
3334
FAN_HIGH,
3435
FAN_LOW,
3536
FAN_MEDIUM,
@@ -230,6 +231,7 @@
230231
FAN_MIDDLE,
231232
FAN_FOCUS,
232233
FAN_DIFFUSE,
234+
FAN_TOP,
233235
HVAC_FAN_MIN,
234236
HVAC_FAN_MEDIUM,
235237
HVAC_FAN_MAX,
@@ -547,12 +549,14 @@ def __init__(
547549
self._attr_hvac_mode = config.get(CONF_INITIAL_OPERATION_MODE)
548550
self._attr_target_temperature_step = config[CONF_TEMP_STEP]
549551
self._attr_hvac_modes = config[CONF_MODES_LIST]
552+
self.use_electra_tweak = False
550553
self._attr_fan_modes = config.get(CONF_FAN_LIST)
551554
if (
552555
isinstance(self._attr_fan_modes, list)
553556
and HVAC_FAN_MAX_HIGH in self._attr_fan_modes
554557
and HVAC_FAN_AUTO_MAX in self._attr_fan_modes
555558
):
559+
self.use_electra_tweak = True
556560
new_fan_list = []
557561
for val in self._attr_fan_modes:
558562
if val == HVAC_FAN_MAX_HIGH:
@@ -797,13 +801,13 @@ async def state_message_received(message: mqtt.ReceiveMessage) -> None:
797801
if "FanSpeed" in payload:
798802
fan_mode = payload["FanSpeed"].lower()
799803
# ELECTRA_AC fan modes fix
800-
if HVAC_FAN_MAX_HIGH in (
801-
self._attr_fan_modes or []
802-
) and HVAC_FAN_AUTO_MAX in (self._attr_fan_modes or []):
804+
if self.use_electra_tweak:
803805
if fan_mode == HVAC_FAN_MAX:
804806
self._attr_fan_mode = FAN_HIGH
805807
elif fan_mode == HVAC_FAN_AUTO:
806808
self._attr_fan_mode = HVAC_FAN_MAX
809+
elif fan_mode == HVAC_FAN_MIN:
810+
self._attr_fan_mode = FAN_LOW
807811
else:
808812
self._attr_fan_mode = fan_mode
809813
else:
@@ -943,9 +947,7 @@ async def async_set_fan_mode(self, fan_mode):
943947
"""Set new target fan mode."""
944948
if fan_mode not in (self._attr_fan_modes or []):
945949
# tweak for some ELECTRA_AC devices
946-
if HVAC_FAN_MAX_HIGH in (
947-
self._attr_fan_modes or []
948-
) and HVAC_FAN_AUTO_MAX in (self._attr_fan_modes or []):
950+
if self.use_electra_tweak:
949951
if fan_mode != FAN_HIGH and fan_mode != HVAC_FAN_MAX:
950952
_LOGGER.error(
951953
"Invalid swing mode selected. Got '%s'. Allowed modes are:",
@@ -960,6 +962,7 @@ async def async_set_fan_mode(self, fan_mode):
960962
)
961963
_LOGGER.error(self._attr_fan_modes)
962964
return
965+
963966
self._attr_fan_mode = fan_mode
964967
if not self._attr_hvac_mode == HVACMode.OFF:
965968
self.power_mode = STATE_ON
@@ -1210,14 +1213,15 @@ async def set_mode(self, hvac_mode):
12101213
async def send_ir(self):
12111214
"""Send the payload to tasmota mqtt topic."""
12121215
fan_speed = self.fan_mode
1216+
12131217
# tweak for some ELECTRA_AC devices
1214-
if HVAC_FAN_MAX_HIGH in (self._attr_fan_modes or []) and HVAC_FAN_AUTO_MAX in (
1215-
self._attr_fan_modes or []
1216-
):
1218+
if self.use_electra_tweak:
12171219
if self.fan_mode == FAN_HIGH:
12181220
fan_speed = HVAC_FAN_MAX
12191221
if self.fan_mode == HVAC_FAN_MAX:
12201222
fan_speed = HVAC_FAN_AUTO
1223+
if self.fan_mode == FAN_LOW:
1224+
fan_speed = HVAC_FAN_MIN
12211225

12221226
# Set the swing mode - default off
12231227
self._swingv = STATE_OFF if self._fix_swingv is None else self._fix_swingv

custom_components/tasmota_irhvac/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"domain": "tasmota_irhvac",
33
"name": "Tasmota Irhvac",
4-
"version": "2024.6.3",
4+
"version": "2026.4.5",
55
"documentation": "https://github.com/hristo-atanasov/Tasmota-IRHVAC",
66
"issue_tracker": "https://github.com/hristo-atanasov/Tasmota-IRHVAC/issues",
7-
"homeassistant": "2022.5.0",
7+
"homeassistant": "2024.11.0",
88
"requirements": [],
99
"dependencies": [
1010
"mqtt",

examples/configuration.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ climate:
4949
#- "middle"
5050
#- "focus"
5151
#- "diffuse"
52+
#- "top"
5253
- "min"
5354
- "max"
5455
#- "auto"

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "Tasmota-IRHVAC",
33
"render_readme": true,
4-
"homeassistant": "2023.05.04"
4+
"homeassistant": "2024.11.0"
55
}

0 commit comments

Comments
 (0)