Improve lists in integrations [I-K] (#113221)

This commit is contained in:
Joost Lekkerkerker 2024-03-13 16:56:33 +01:00 committed by GitHub
parent dbb07c98e2
commit 7e0aac3feb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 136 additions and 143 deletions

View file

@ -204,10 +204,10 @@ class KNXClimate(KnxEntity, ClimateEntity):
"""Return the list of available operation/controller modes."""
ha_controller_modes: list[HVACMode | None] = []
if self._device.mode is not None:
for knx_controller_mode in self._device.mode.controller_modes:
ha_controller_modes.append(
CONTROLLER_MODES.get(knx_controller_mode.value)
)
ha_controller_modes.extend(
CONTROLLER_MODES.get(knx_controller_mode.value)
for knx_controller_mode in self._device.mode.controller_modes
)
if self._device.supports_on_off:
if not ha_controller_modes: