Skip to content

Commit

Permalink
default to mirek
Browse files Browse the repository at this point in the history
  • Loading branch information
philipparndt committed Jan 17, 2022
1 parent 75e90b4 commit b83f71d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/messages/light-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const fromLight = (light: Light) => {
if (light.color_temperature) {
message.color_temp = light.color_temperature.mirek
}

if (light.color) {
else if (light.color) {
message.color = light.color.xy
}

Expand All @@ -44,7 +43,7 @@ export const toLight = (template: Light, message: LightMessage) => {
if (message.color_temp && template.color_temperature) {
result.color_temperature = { ...template.color_temperature, mirek: message.color_temp }
}
if (message.color && template.color) {
else if (message.color && template.color) {
result.color = { ...template.color, xy: message.color }
}

Expand Down

0 comments on commit b83f71d

Please sign in to comment.