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