From 401b599d3384563a9d3a7270f32fe2268679ff0c Mon Sep 17 00:00:00 2001 From: sparks-alec Date: Sun, 11 Dec 2022 04:24:59 -0500 Subject: [PATCH] load plugin info when device is created --- src/device.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/device.js b/src/device.js index cf16a4f..6d9dcb6 100644 --- a/src/device.js +++ b/src/device.js @@ -66,6 +66,8 @@ function registerDevice(newDevice) { }, }; + devices[id].plugin = PLUGINS.all[newDevice.type]; + if(PLUGINS.all[newDevice.type].config.fields){ PLUGINS.all[newDevice.type].config.fields.forEach(field => { devices[id].fields[field.key] = field.value; @@ -199,7 +201,7 @@ function initDeviceConnection(id) { device.send = (data) => {}; } - device.plugin = plugins[type]; + //device.plugin = plugins[type]; return true; }