Fix none-check in template light (#62089)

pull/62091/head
Erik Montnemery 2021-12-16 16:12:43 +01:00 committed by GitHub
parent 9bf7e25e6c
commit c9320b5ca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -567,9 +567,13 @@ class LightTemplate(TemplateEntity, LightEntity):
@callback @callback
def _update_color(self, render): def _update_color(self, render):
"""Update the hs_color from the template.""" """Update the hs_color from the template."""
if render is None:
self._color = None
return
h_str = s_str = None h_str = s_str = None
if isinstance(render, str): if isinstance(render, str):
if render in (None, "None", ""): if render in ("None", ""):
self._color = None self._color = None
return return
h_str, s_str = map( h_str, s_str = map(