Fixed broken device type query
Replaced "Devices.LED_LIGHTS" with "DeviceType.LED_LIGHTS" Because "Devices.LED_LIGHTS" is undefined (maybe deprecated)
This commit is contained in:
parent
d4c28982c4
commit
c077d63333
@ -117,7 +117,7 @@ poweredUP.on("discover", async (hub) => {
|
|||||||
hub.setLEDColor(train.color);
|
hub.setLEDColor(train.color);
|
||||||
console.log(`Connected to ${train.name} (${hub.name})`);
|
console.log(`Connected to ${train.name} (${hub.name})`);
|
||||||
hub.on("attach", (port, type) => {
|
hub.on("attach", (port, type) => {
|
||||||
if (type === PoweredUP.Consts.Devices.LED_LIGHTS && trainHub.lights && trainHub.lights.indexOf(port) >= 0) {
|
if (type === PoweredUP.Consts.DeviceType.LED_LIGHTS && trainHub.lights && trainHub.lights.indexOf(port) >= 0) {
|
||||||
hub.setLightBrightness(port, 100);
|
hub.setLightBrightness(port, 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -133,4 +133,4 @@ poweredUP.on("discover", async (hub) => {
|
|||||||
|
|
||||||
|
|
||||||
poweredUP.scan(); // Start scanning for trains
|
poweredUP.scan(); // Start scanning for trains
|
||||||
console.log("Looking for trains...");
|
console.log("Looking for trains...");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user