patch: Fix LEDs init error

Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2021-09-30 13:05:47 +02:00
parent b165fb78da
commit 4232928ad8

View File

@ -245,7 +245,6 @@ export async function init(): Promise<void> {
for (const [drivePath, ledsNames] of Object.entries(ledsMapping)) { for (const [drivePath, ledsNames] of Object.entries(ledsMapping)) {
leds.set('/dev/disk/by-path/' + drivePath, new RGBLed(ledsNames)); leds.set('/dev/disk/by-path/' + drivePath, new RGBLed(ledsNames));
} }
}
ledColors = (await settings.get('ledColors')) || {}; ledColors = (await settings.get('ledColors')) || {};
ledAnimationFunctions = { ledAnimationFunctions = {
blinkGreen: createAnimationFunction(blink, ledColors['green']), blinkGreen: createAnimationFunction(blink, ledColors['green']),
@ -257,4 +256,5 @@ export async function init(): Promise<void> {
staticBlack: createAnimationFunction(one, ledColors['black']), staticBlack: createAnimationFunction(one, ledColors['black']),
}; };
observe(_.debounce(stateObserver, 1000, { maxWait: 1000 })); observe(_.debounce(stateObserver, 1000, { maxWait: 1000 }));
}
} }