Fix none-check in template light (#62089)

This commit is contained in:
Erik Montnemery
2021-12-16 16:12:43 +01:00
committed by GitHub
parent 9bf7e25e6c
commit c9320b5ca1

View File

@@ -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(