1
mirror of https://github.com/home-assistant/core synced 2024-07-15 09:42:11 +02:00

Fix preset modes error in Smartthings (#105375)

This commit is contained in:
G Johansson 2023-12-09 13:49:32 +01:00 committed by GitHub
parent 25586f9efd
commit f37f40c338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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