Handle lutron_caseta fan speed being none (#47120)

This commit is contained in:
J. Nick Koston
2021-02-26 18:33:31 -06:00
committed by GitHub
parent 86f8cd8037
commit 49315a90d9

View File

@@ -44,6 +44,8 @@ class LutronCasetaFan(LutronCasetaDevice, FanEntity):
@property
def percentage(self) -> str:
"""Return the current speed percentage."""
if self._device["fan_speed"] is None:
return None
return ordered_list_item_to_percentage(
ORDERED_NAMED_FAN_SPEEDS, self._device["fan_speed"]
)