Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIDL 14149505L/14149506L color fixes #5588

Merged
merged 2 commits into from
Mar 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions devices/lidl.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ const tzLocal = {
// Load current state or defaults
const newSettings = {
brightness: meta.state.brightness ?? 254, // full brightness
hue: (meta.state.color ?? {}).h ?? 0, // red
saturation: (meta.state.color ?? {}).s ?? 100, // full saturation
hue: (meta.state.color ?? {}).hue ?? 0, // red
saturation: (meta.state.color ?? {}).saturation ?? 100, // full saturation
};

// Apply changes
Expand All @@ -217,8 +217,8 @@ const tzLocal = {
newSettings.saturation = color.saturation;

newState.color = {
h: color.hue,
s: color.saturation,
hue: color.hue,
saturation: color.saturation,
};
}

Expand All @@ -234,6 +234,10 @@ const tzLocal = {
}
}

// If we're in white mode, calculate a matching display color for the set color temperature. This also kind
// of works in the other direction.
Object.assign(newState, libColor.syncColorState(newState, meta.state, entity, meta.options, meta.logger));

return {state: newState};
},
convertGet: async (entity, key, meta) => {
Expand Down