Fix lutron caseta fan handling of speed off (#47244)

This commit is contained in:
J. Nick Koston 2021-03-01 17:18:47 -06:00 committed by GitHub
parent 96cc17b462
commit 2e65a60624
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,6 +46,8 @@ class LutronCasetaFan(LutronCasetaDevice, FanEntity):
"""Return the current speed percentage."""
if self._device["fan_speed"] is None:
return None
if self._device["fan_speed"] == FAN_OFF:
return 0
return ordered_list_item_to_percentage(
ORDERED_NAMED_FAN_SPEEDS, self._device["fan_speed"]
)