Handle lutron_caseta fan speed being none (#47120)

This commit is contained in:
J. Nick Koston
2021-02-28 20:21:39 +00:00
committed by Paulus Schoutsen
parent 505ca07c4e
commit dd4f8bf4b4
@@ -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"]
)