mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Better light.xy_color parsing
This commit is contained in:
parent
5f9787aeb2
commit
2220df5a3e
@ -262,7 +262,8 @@ def setup(hass, config):
|
|||||||
# xy_color should be a list containing 2 floats
|
# xy_color should be a list containing 2 floats
|
||||||
xycolor = dat.get(ATTR_XY_COLOR)
|
xycolor = dat.get(ATTR_XY_COLOR)
|
||||||
|
|
||||||
if len(xycolor) == 2:
|
# Without this check, a xycolor with value '99' would work
|
||||||
|
if not isinstance(xycolor, str):
|
||||||
params[ATTR_XY_COLOR] = [float(val) for val in xycolor]
|
params[ATTR_XY_COLOR] = [float(val) for val in xycolor]
|
||||||
|
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user