Skip to content

Commit 2dba1f9

Browse files
committed
Improve handling of unknown broadlink devices
1 parent cb4ed87 commit 2dba1f9

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

index.js

+26-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,32 @@ Broadlink.prototype.genDevice = function (devtype, host, mac){
5454
dev.rm(true);
5555
return dev;;
5656
}else{
57-
return null;
57+
if(devtype == 0){ // SP1
58+
return null;;
59+
}else if(devtype == 0x2711){ // SP2
60+
return null;;
61+
}else if(devtype == 0x2719 || devtype == 0x7919 || devtype == 0x271a || devtype == 0x791a){ // Honeywell SP2
62+
return null;;
63+
}else if(devtype == 0x2720){ // SPMini
64+
return null;;
65+
}else if(devtype == 0x753e){ // SP3
66+
return null;;
67+
}else if(devtype == 0x2728){ // SPMini2
68+
return null;;
69+
}else if(devtype == 0x2733 || devtype == 0x273e){ // OEM branded SPMini
70+
return null;;
71+
}else if(devtype >= 0x7530 && devtype <= 0x7918){ // OEM branded SPMini2
72+
return null;;
73+
}else if(devtype == 0x2736){ // SPMiniPlus
74+
return null;;
75+
}else if(devtype == 0x2714){ // A1
76+
return null;;
77+
}else if(devtype == 0x4EB5){ // MP1
78+
return null;;
79+
}
80+
81+
console.log(`\n\x1b[31m[Important!]\x1b[30m We've discovered an unknown Broadlink device.\n\nPlease raise an issue in the GitHub repository (https://github.com/lprhodes/homebridge-broadlink-rm/issues) with details of the type of device and its device type code: "${devtype.toString(16)}" so that we can handle it correctly and prevent this message from appearing.\n`);
82+
return null;
5883
}
5984
}
6085

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "broadlinkjs-rm",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "A Node.JS fork of broadlinkjs specifically intended for interacting with RM devices in homebridge-broadlink-rm",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)