From 702e63e6e8707841b4e3c232154c8c35143cf4d4 Mon Sep 17 00:00:00 2001 From: tyjtyj Date: Tue, 10 Sep 2019 03:44:00 +0800 Subject: [PATCH] Fix Tuya Light without brightness (#26534) Return none if there is brightness data from tuya https://github.com/home-assistant/home-assistant/issues/25896 --- homeassistant/components/tuya/light.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/tuya/light.py b/homeassistant/components/tuya/light.py index 2c72dd60490..9ac72419612 100644 --- a/homeassistant/components/tuya/light.py +++ b/homeassistant/components/tuya/light.py @@ -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