From 6591bfc0228570d073f1d585d5c7d1ce77f39cdc Mon Sep 17 00:00:00 2001 From: Christoph Brand Date: Thu, 11 Jul 2024 18:29:47 +0200 Subject: [PATCH] fix: Add hs null check to avoid light crash (#748) Avoid a crash on the hs light check if none is set. Fixes #746 --- custom_components/tapo/light.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/tapo/light.py b/custom_components/tapo/light.py index 7b368be..9a44031 100755 --- a/custom_components/tapo/light.py +++ b/custom_components/tapo/light.py @@ -81,6 +81,9 @@ def brightness(self): @property def hs_color(self): + if self.device.hs is None: + return None + (hue, saturation) = (self.device.hs.hue, self.device.hs.saturation) color_temp = self.device.color_temp if (