From a72241dce1f068f4306f99f9c7c7c59b4f9fc8bd Mon Sep 17 00:00:00 2001 From: Robert Hesselmann Date: Wed, 21 Aug 2024 12:05:08 +0200 Subject: [PATCH] Add wled to light controller (#46) --- src/main/lightController/controlAllLights.ts | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/lightController/controlAllLights.ts b/src/main/lightController/controlAllLights.ts index c80b5f0..d96e27a 100644 --- a/src/main/lightController/controlAllLights.ts +++ b/src/main/lightController/controlAllLights.ts @@ -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", @@ -113,6 +114,15 @@ export async function controlAllLights({ event, }); } + + if (config.wledEnabled) { + await wledControl({ + controlType, + color, + brightness, + }); + } + } export async function turnOffAllLights() { @@ -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, + }); + } }