From e3c94486562fc008ddcffcd62696bcb4f27186a0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 16 May 2018 19:22:47 +0200 Subject: [PATCH] cId -> cid. #45 --- lib/controller.js | 2 +- lib/converters/mqtt2zigbee.js | 8 ++++---- lib/zigbee.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/controller.js b/lib/controller.js index ec5efeee..220ed026 100644 --- a/lib/controller.js +++ b/lib/controller.js @@ -201,7 +201,7 @@ class Controller { } }; - this.zigbee.publish(deviceID, message.cId, message.cmd, message.zclData, ep, callback); + this.zigbee.publish(deviceID, message.cid, message.cmd, message.zclData, ep, callback); }); } diff --git a/lib/converters/mqtt2zigbee.js b/lib/converters/mqtt2zigbee.js index 96e663d5..80f33d22 100644 --- a/lib/converters/mqtt2zigbee.js +++ b/lib/converters/mqtt2zigbee.js @@ -1,14 +1,14 @@ const converters = { "state": (value) => { return { - cId: 'genOnOff', + cid: 'genOnOff', cmd: value.toLowerCase(), zclData: {}, } }, "brightness": (value) => { return { - cId: 'genLevelCtrl', + cid: 'genLevelCtrl', cmd: 'moveToLevel', zclData: { level: value, @@ -18,7 +18,7 @@ const converters = { }, "color_temp": (value) => { return { - cId: 'lightingColorCtrl', + cid: 'lightingColorCtrl', cmd: 'moveToColorTemp', zclData: { colortemp: value, @@ -28,7 +28,7 @@ const converters = { }, "color": (value) => { return { - cId: 'lightingColorCtrl', + cid: 'lightingColorCtrl', cmd: 'moveToColor', zclData: { colorx: value.x * 65535, diff --git a/lib/zigbee.js b/lib/zigbee.js index a102ee44..0205dba7 100644 --- a/lib/zigbee.js +++ b/lib/zigbee.js @@ -108,7 +108,7 @@ class Zigbee { return this.shepherd.list().find((d) => d.ieeeAddr === deviceID); } - publish(deviceID, cId, cmd, zclData, ep, callback) { + publish(deviceID, cid, cmd, zclData, ep, callback) { // Find device in zigbee-shepherd let device = this.getDevice(deviceID); if (!device || !device.epList || !device.epList.length) { @@ -124,8 +124,8 @@ class Zigbee { return; } - logger.info(`Zigbee publish to '${deviceID}', ${cId} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`); - device.functional(cId, cmd, zclData, callback); + logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`); + device.functional(cid, cmd, zclData, callback); } }