Skip to content

Commit

Permalink
Update main.ts
Browse files Browse the repository at this point in the history
ct range from 2200-6500 to 2000-6500
issue iobroker-community-adapters#586
  • Loading branch information
Draygv2 authored Oct 4, 2024
1 parent 63aee7a commit 4b4cb0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ class Hue extends utils.Adapter {
return;
}

finalLS.ct = Math.max(2200, Math.min(6500, ls.ct));
finalLS.ct = Math.max(2000, Math.min(6500, ls.ct));
finalLS.ct = hueHelper.miredToKelvin(finalLS.ct);

lightState = lightState.ct(finalLS.ct);
Expand Down Expand Up @@ -746,7 +746,7 @@ class Hue extends utils.Adapter {
lightState = lightState.hue(finalLS.hue);
}
if ('ct_inc' in ls && !('ct' in finalLS) && 'ct' in alls) {
alls.ct = 500 - 153 - ((alls.ct - 2200) / (6500 - 2200)) * (500 - 153) + 153;
alls.ct = 500 - 153 - ((alls.ct - 2000) / (6500 - 2000)) * (500 - 153) + 153;

finalLS.ct = ((((alls.ct - 153 + ls.ct_inc) % 348) + 348) % 348) + 153;
if (!lampOn && (!('bri' in ls) || ls.bri === 0) && this.config.turnOnWithOthers) {
Expand Down

0 comments on commit 4b4cb0c

Please sign in to comment.