@mschaeffler/node-red-bthome 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bthome.js +34 -1
  2. package/package.json +1 -1
package/bthome.js CHANGED
@@ -4,10 +4,42 @@ const Rawdata = require( "./rawdata.js" );
4
4
  const BtEvent = require( "./btevent.js" );
5
5
 
6
6
  class TypeIds {
7
+ static bluButton = 1;
7
8
  static bluDW = 2;
8
9
  static bluRemote = 9;
9
10
  }
11
+ class DeviceNames {
12
+ static 0x01 = "SBBT-002C";
13
+ static 0x02 = "SBDW-002C";
14
+ static 0x03 = "SBHT-003C";
15
+ static 0x05 = "SBHT-003C";
16
+ static 0x06 = "SBBT-004CEU";
17
+ static 0x07 = "SBBT-004CUS";
18
+ static 0x08 = "SBTR-001AEU";
19
+ static 0x09 = "SBRC-005B";
20
+ static 0x0A = "SBDI-003E";
21
+ static 0x0B = "SBWS-90CM";
22
+ static 0x0C = "SBHT-103C";
23
+ static 0x11 = "SBHT-203C";
24
+ static 0x14 = "SBDW-103C";
25
+ static 0x15 = "SBBT-104CEU"
26
+ static 0x16 = "SBBT-104CUS";
27
+ static 0x17 = "SBBT-102C";
28
+ static 0x201A = "SBCB-01PXNEUB6";
29
+ static 0x201B = "SBCB-01PXNEUB10";
30
+ static 0x201C = "SBCB-01PXNEUB13";
31
+ static 0x201D = "SBCB-01PXNEUB16";
32
+ static 0x201E = "SBCB-01PXNEUB20";
33
+ static 0x201F = "SBCB-01PXNEUB25";
34
+ static 0x203A = "SBCB-01PXNEUC6";
35
+ static 0x203B = "SBCB-01PXNEUC10";
36
+ static 0x203C = "SBCB-01PXNEUC13";
37
+ static 0x203D = "SBCB-01PXNEUC16";
38
+ static 0x203E = "SBCB-01PXNEUC20";
39
+ static 0x203F = "SBCB-01PXNEUC25";
40
+ }
10
41
  Object.freeze( TypeIds );
42
+ Object.freeze( DeviceNames );
11
43
 
12
44
  module.exports = function(RED) {
13
45
 
@@ -269,7 +301,8 @@ module.exports = function(RED) {
269
301
  setData( "channel", rawdata.getUInt8() + 1 );
270
302
  break;
271
303
  case 0xF0:
272
- item.typeId = rawdata.getUInt16() & 0xFF;
304
+ item.typeId = rawdata.getUInt16() & 0xF0FF;
305
+ item.model = DeviceNames[item.typeId] ?? null;
273
306
  break;
274
307
  case 0xF1:
275
308
  item.version = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mschaeffler/node-red-bthome",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "A Node Red node to decrypt and decode BT-Home frames",
5
5
  "author": {
6
6
  "name": "Mathias Schäffler",