Fix Tuya Light without brightness (#26534)

Return none if there is brightness data from tuya

https://github.com/home-assistant/home-assistant/issues/25896
This commit is contained in:
tyjtyj 2019-09-10 03:44:00 +08:00 committed by Martin Hjelmare
parent 7d71976e01
commit 702e63e6e8

View File

@ -40,6 +40,8 @@ class TuyaLight(TuyaDevice, Light):
@property
def brightness(self):
"""Return the brightness of the light."""
if self.tuya.brightness() is None:
return None
return int(self.tuya.brightness())
@property