Skip to content

Commit

Permalink
Add wled to light controller (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtremTechniker authored Aug 21, 2024
1 parent 04b88e8 commit a72241d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/lightController/controlAllLights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { philipsHueControl } from "./integrations/philipsHue/api";
import { streamdeckControl } from "./integrations/streamdeck/api";
import { tradfriControl } from "./integrations/tradfri/api";
import { webServerControl } from "./integrations/webserver/api";
import { wledControl } from "./integrations/wled/api";

export enum ControlType {
On = "On",
Expand Down Expand Up @@ -113,6 +114,15 @@ export async function controlAllLights({
event,
});
}

if (config.wledEnabled) {
await wledControl({
controlType,
color,
brightness,
});
}

}

export async function turnOffAllLights() {
Expand Down Expand Up @@ -213,4 +223,16 @@ export async function turnOffAllLights() {
event: fallBackEvent,
});
}

if (config.wledEnabled) {
await wledControl({
controlType: ControlType.Off,
color: {
r: 0,
g: 0,
b: 0,
},
brightness: 100,
});
}
}

0 comments on commit a72241d

Please sign in to comment.