Skip to content

Commit

Permalink
make super sure hs does not crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Garfonso committed Mar 7, 2024
1 parent ebe9c93 commit f42140a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/converters/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit f42140a

Please sign in to comment.