Skip to content

Commit

Permalink
feat: Add current level startup to all IKEA TRADFRI lights (#8049)
Browse files Browse the repository at this point in the history
* added current level startup to ikea LED2005R5/LED2106R3

* moved current level startup to ikeaLight
  • Loading branch information
dannyneup authored Sep 30, 2024
1 parent 047cfc0 commit 3f9376f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/ikea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ const bulbOnEvent: OnEvent = async (type, data, device, options, state: KeyValue

export function ikeaLight(args?: Omit<LightArgs, 'colorTemp'> & {colorTemp?: true | {range: Range; viaColor: true}}) {
const colorTemp: {range: Range} = args?.colorTemp ? (args.colorTemp === true ? {range: [250, 454]} : args.colorTemp) : undefined;
const result = lightDontUse({...args, colorTemp});
const levelConfig: {disabledFeatures?: string[]} = args?.levelConfig
? args.levelConfig
: {disabledFeatures: ['on_off_transition_time', 'on_transition_time', 'off_transition_time', 'on_level']};
const result = lightDontUse({...args, colorTemp, levelConfig});
result.ota = ikea;
result.onEvent = bulbOnEvent;
if (isObject(args?.colorTemp) && args.colorTemp.viaColor) {
Expand Down

0 comments on commit 3f9376f

Please sign in to comment.