From f42140a1793a6b1ad425c9aa263f198d1723f766 Mon Sep 17 00:00:00 2001 From: Garfonso Date: Thu, 7 Mar 2024 11:36:13 +0100 Subject: [PATCH] make super sure hs does not crash --- lib/converters/light.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/converters/light.js b/lib/converters/light.js index e11a6254c..c4b10c551 100644 --- a/lib/converters/light.js +++ b/lib/converters/light.js @@ -208,6 +208,9 @@ function _lightAdvancedAddHueAndSat(states, objects, entity) { } state = state || {val: 0}; + if (!targetAttributes.hs_color) { + targetAttributes.hs_color = [0, 100]; + } targetAttributes.hs_color[0] = state.val / attr.max * 360; targetAttributes.color_mode = HS; };