Merge pull request #3062 from balena-io/init-leds-map

Initialize leds object map
This commit is contained in:
Alexis Svinartchouk 2020-02-05 13:35:10 +01:00 committed by GitHub
commit 8771f311d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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));
}