diff --git a/custom_components/tasmota_irhvac/climate.py b/custom_components/tasmota_irhvac/climate.py index 53df2d6..c916f89 100644 --- a/custom_components/tasmota_irhvac/climate.py +++ b/custom_components/tasmota_irhvac/climate.py @@ -618,12 +618,14 @@ def __init__( new_fan_list.append(val) self._attr_fan_modes = new_fan_list if len(new_fan_list) else None self._attr_fan_mode = ( - self._attr_fan_modes[0] if isinstance(self._attr_fan_modes, list) else None + self._attr_fan_modes[0] + if isinstance(self._attr_fan_modes, list) and len(self._attr_fan_modes) + else None ) self._attr_swing_modes = config.get(CONF_SWING_LIST) self._attr_swing_mode = ( self._attr_swing_modes[0] - if isinstance(self._attr_swing_modes, list) + if isinstance(self._attr_swing_modes, list) and len(self._attr_swing_modes) else None ) self._attr_preset_modes = (