From b8f09542b65cabfe3d83752572fe4e11350d4ee6 Mon Sep 17 00:00:00 2001 From: Tobias Hopp Date: Mon, 17 Apr 2023 09:26:23 +0200 Subject: [PATCH] HOTFIX Took 11 minutes --- src/LEDHandler.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LEDHandler.ts b/src/LEDHandler.ts index 91b557d..5889f54 100644 --- a/src/LEDHandler.ts +++ b/src/LEDHandler.ts @@ -46,7 +46,7 @@ export class LEDHandler { } static init(): Promise { - return new Promise(async () => { + return new Promise(async (resolve) => { const options = { dma: 10, freq: 800000, @@ -59,15 +59,17 @@ export class LEDHandler { this.channel = ws281x(20, options); setInterval(this.loop, 1000); + resolve(); }); } private static loop(): Promise { - return new Promise(() => { + return new Promise((resolve) => { if (this.currentInterval) return; LEDHandler.ambientColor(); + resolve(); }); }