From c9320b5ca10b46871570bbcb34212d90e6cac55c Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 16 Dec 2021 16:12:43 +0100 Subject: [PATCH] Fix none-check in template light (#62089) --- homeassistant/components/template/light.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/template/light.py b/homeassistant/components/template/light.py index a96d01fe4fa..317e1349dc9 100644 --- a/homeassistant/components/template/light.py +++ b/homeassistant/components/template/light.py @@ -567,9 +567,13 @@ class LightTemplate(TemplateEntity, LightEntity): @callback def _update_color(self, render): """Update the hs_color from the template.""" + if render is None: + self._color = None + return + h_str = s_str = None if isinstance(render, str): - if render in (None, "None", ""): + if render in ("None", ""): self._color = None return h_str, s_str = map(