Merge pull request #17 from davidcolombogit/master

Fixed broken device type query
This commit is contained in:
Nathan Kellenicki 2019-02-04 09:58:41 -08:00 committed by GitHub
commit 31795fa4b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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