HOTFIX
Took 11 minutes
This commit is contained in:
parent
b7a500f149
commit
b8f09542b6
@ -46,7 +46,7 @@ export class LEDHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static init(): Promise<void> {
|
static init(): Promise<void> {
|
||||||
return new Promise<void>(async () => {
|
return new Promise<void>(async (resolve) => {
|
||||||
const options = {
|
const options = {
|
||||||
dma: 10,
|
dma: 10,
|
||||||
freq: 800000,
|
freq: 800000,
|
||||||
@ -59,15 +59,17 @@ export class LEDHandler {
|
|||||||
this.channel = ws281x(20, options);
|
this.channel = ws281x(20, options);
|
||||||
|
|
||||||
setInterval(this.loop, 1000);
|
setInterval(this.loop, 1000);
|
||||||
|
resolve();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static loop(): Promise<void> {
|
private static loop(): Promise<void> {
|
||||||
return new Promise<void>(() => {
|
return new Promise<void>((resolve) => {
|
||||||
if (this.currentInterval)
|
if (this.currentInterval)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LEDHandler.ambientColor();
|
LEDHandler.ambientColor();
|
||||||
|
resolve();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user