Fix preset modes error in Smartthings (#105375)

This commit is contained in:
G Johansson 2023-12-09 13:49:32 +01:00 committed by Franck Nijhof
parent ef17950d76
commit 15cf732463
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -528,10 +528,10 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity):
def _determine_preset_modes(self) -> list[str] | None:
"""Return a list of available preset modes."""
supported_modes = self._device.status.attributes[
supported_modes: list | None = self._device.status.attributes[
"supportedAcOptionalMode"
].value
if WINDFREE in supported_modes:
if supported_modes and WINDFREE in supported_modes:
return [WINDFREE]
return None