diff --git a/index.js b/index.js index d175395..396a595 100644 --- a/index.js +++ b/index.js @@ -44,6 +44,7 @@ rm4DeviceTypes[parseInt(0x6070, 16)] = "Broadlink RM4 Mini C"; rm4DeviceTypes[parseInt(0x62be, 16)] = "Broadlink RM4 Mini C"; rm4DeviceTypes[parseInt(0x610f, 16)] = "Broadlink RM4 Mini C"; rm4DeviceTypes[parseInt(0x6539, 16)] = "Broadlink RM4 Mini C"; +rm4DeviceTypes[parseInt(0x520d, 16)] = "Broadlink RM4 Mini C"; rm4DeviceTypes[parseInt(0x648d, 16)] = "Broadlink RM4 Mini S"; rm4DeviceTypes[parseInt(0x5216, 16)] = "Broadlink RM4 Mini"; rm4DeviceTypes[parseInt(0x520c, 16)] = "Broadlink RM4 Mini"; @@ -216,7 +217,7 @@ class Broadlink extends EventEmitter { addDevice (host, macAddress, deviceType) { const { log, debug } = this; - if (this.devices[macAddress]) return; + if (this.devices[macAddress.toString('hex')]) return; const isHostObjectValid = ( typeof host === 'object' && @@ -230,7 +231,7 @@ class Broadlink extends EventEmitter { // Mark is at not supported by default so we don't try to // create this device again. - this.devices[macAddress] = 'Not Supported'; + this.devices[macAddress.toString('hex')] = 'Not Supported'; // Ignore devices that don't support infrared or RF. if (unsupportedDeviceTypes[parseInt(deviceType, 16)]) return null; @@ -251,7 +252,7 @@ class Broadlink extends EventEmitter { device.log = log; device.debug = debug; - this.devices[macAddress] = device; + this.devices[macAddress.toString('hex')] = device; // Authenticate the device and let others know when it's ready. device.on('deviceReady', () => { diff --git a/package.json b/package.json index 34f997f..f3d26a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kiwicam-broadlinkjs-rm", - "version": "0.9.20-beta.0", + "version": "0.9.20-beta.1", "description": "A Node.JS fork of broadlinkjs specifically intended for interacting with RM devices in homebridge-broadlink-rm", "main": "index.js", "scripts": {