Fix TypeError when climate component sets fan modes to None (#54709)

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Brian Egge 2021-08-16 13:02:01 -04:00 committed by GitHub
parent 35389a6d28
commit 441552e04c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1290,7 +1290,7 @@ class FanSpeedTrait(_Trait):
)
elif domain == climate.DOMAIN:
modes = self.state.attributes.get(climate.ATTR_FAN_MODES, [])
modes = self.state.attributes.get(climate.ATTR_FAN_MODES) or []
for mode in modes:
speed = {
"speed_name": mode,