Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix #147 index error when swing_modes is empty #148

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions custom_components/tasmota_irhvac/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,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 = (
Expand Down
Loading