Merge pull request #17 from davidcolombogit/master
Fixed broken device type query
This commit is contained in:
commit
31795fa4b4
@ -117,7 +117,7 @@ poweredUP.on("discover", async (hub) => {
|
||||
hub.setLEDColor(train.color);
|
||||
console.log(`Connected to ${train.name} (${hub.name})`);
|
||||
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);
|
||||
}
|
||||
});
|
||||
@ -133,4 +133,4 @@ poweredUP.on("discover", async (hub) => {
|
||||
|
||||
|
||||
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