From c077d63333900c04252e3ef73c9e5a70de38a5cc Mon Sep 17 00:00:00 2001 From: David Colombo <32454162+davidcolombogit@users.noreply.github.com> Date: Mon, 4 Feb 2019 17:00:07 +0100 Subject: [PATCH] Fixed broken device type query Replaced "Devices.LED_LIGHTS" with "DeviceType.LED_LIGHTS" Because "Devices.LED_LIGHTS" is undefined (maybe deprecated) --- examples/train_controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/train_controller.js b/examples/train_controller.js index 922ff85..268eeb1 100644 --- a/examples/train_controller.js +++ b/examples/train_controller.js @@ -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..."); \ No newline at end of file +console.log("Looking for trains...");