Initialize leds object map

Fixes: #3056 #3057 #3058
Change-type: patch
Changelog-entry: Initialize leds object map
This commit is contained in:
Omar López 2020-02-04 18:42:52 -07:00 committed by Alexis Svinartchouk
parent f8b46dc647
commit fdec65e9bd

View File

@ -190,9 +190,8 @@ export function init() {
// ],
// ...
// }
const ledsMapping: _.Dictionary<[string, string, string]> = settings.get(
'ledsMapping',
);
const ledsMapping: _.Dictionary<[string, string, string]> =
settings.get('ledsMapping') || {};
for (const [drivePath, ledsPaths] of Object.entries(ledsMapping)) {
leds.set('/dev/disk/by-path/' + drivePath, new RGBLed(ledsPaths));
}