smart-bus 0.6.0 → 0.8.0

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.
@@ -3,14 +3,14 @@ module.exports = {
3
3
 
4
4
  // 4.1.1 Scene Control
5
5
  '0x0002': {
6
- payload: new Buffer('0403', 'hex'),
6
+ payload: Buffer.from('0403', 'hex'),
7
7
  data: { area: 4, scene: 3 }
8
8
  },
9
9
 
10
10
  // 4.1.2 Scene Control Response
11
11
  '0x0003': [
12
12
  {
13
- payload: new Buffer('0201060A', 'hex'),
13
+ payload: Buffer.from('0201060A', 'hex'),
14
14
  data: { area: 2, scene: 1, channels: [
15
15
  { number: 1, status: false },
16
16
  { number: 2, status: true },
@@ -21,7 +21,7 @@ module.exports = {
21
21
  ] }
22
22
  },
23
23
  {
24
- payload: new Buffer('02010608', 'hex'),
24
+ payload: Buffer.from('02010608', 'hex'),
25
25
  data: { area: 2, scene: 1, channels: [
26
26
  { number: 1, status: false },
27
27
  { number: 2, status: false },
@@ -32,7 +32,7 @@ module.exports = {
32
32
  ] }
33
33
  },
34
34
  {
35
- payload: new Buffer('01010CA508', 'hex'),
35
+ payload: Buffer.from('01010CA508', 'hex'),
36
36
  data: { area: 1, scene: 1, channels: [
37
37
  { number: 1, status: true },
38
38
  { number: 2, status: false },
@@ -52,20 +52,20 @@ module.exports = {
52
52
 
53
53
  // 4.1.3 Read Status of Scene
54
54
  '0x000C': {
55
- payload: new Buffer('06', 'hex'),
55
+ payload: Buffer.from('06', 'hex'),
56
56
  data: { area: 6 }
57
57
  },
58
58
 
59
59
  // 4.1.4 Response Read Status of Scene
60
60
  '0x000D': {
61
- payload: new Buffer('06FE', 'hex'),
61
+ payload: Buffer.from('06FE', 'hex'),
62
62
  data: { area: 6, scene: 254 }
63
63
  },
64
64
 
65
65
  // 4.1.5 Broadcast Status of Scene
66
66
  '0xEFFF': [
67
67
  {
68
- payload: new Buffer('04FEFEFEFE060B', 'hex'),
68
+ payload: Buffer.from('04FEFEFEFE060B', 'hex'),
69
69
  data: {
70
70
  areas: [
71
71
  { number: 1, scene: 254 },
@@ -84,7 +84,7 @@ module.exports = {
84
84
  },
85
85
  },
86
86
  {
87
- payload: new Buffer('04FEFEFEFE0C0B08', 'hex'),
87
+ payload: Buffer.from('04FEFEFEFE0C0B08', 'hex'),
88
88
  data: {
89
89
  areas: [
90
90
  { number: 1, scene: 254 },
@@ -114,7 +114,7 @@ module.exports = {
114
114
 
115
115
  // 4.1.7 Response Read Area Information
116
116
  '0x0005': {
117
- payload: new Buffer('0269010404010200040003', 'hex'),
117
+ payload: Buffer.from('0269010404010200040003', 'hex'),
118
118
  data: {
119
119
  device: { type: 617, subnet: 1, id: 4 },
120
120
  areas: 4,
@@ -131,14 +131,14 @@ module.exports = {
131
131
 
132
132
  // 4.1.8 Read Scene Information
133
133
  '0x0000': {
134
- payload: new Buffer('0102', 'hex'),
134
+ payload: Buffer.from('0102', 'hex'),
135
135
  data: { area: 1, scene: 2 }
136
136
  },
137
137
 
138
138
  // 4.1.9 Read Scene Information Response
139
139
  '0x0001': [
140
140
  {
141
- payload: new Buffer('010205AD326464323232', 'hex'),
141
+ payload: Buffer.from('010205AD326464323232', 'hex'),
142
142
  data: { area: 1, scene: 2, time: 1453, channels: [
143
143
  { number: 1, level: 50 },
144
144
  { number: 2, level: 100 },
@@ -149,7 +149,7 @@ module.exports = {
149
149
  ] }
150
150
  },
151
151
  {
152
- payload: new Buffer('010305A032646432', 'hex'),
152
+ payload: Buffer.from('010305A032646432', 'hex'),
153
153
  data: { area: 1, scene: 3, time: 1440, channels: [
154
154
  { number: 1, level: 50 },
155
155
  { number: 2, level: 100 },
@@ -168,31 +168,31 @@ module.exports = {
168
168
 
169
169
  // 4.2.1 Sequence Control
170
170
  '0x001A': {
171
- payload: new Buffer('0102', 'hex'),
171
+ payload: Buffer.from('0102', 'hex'),
172
172
  data: { area: 1, sequence: 2 }
173
173
  },
174
174
 
175
175
  // 4.2.2 Response Sequence Control
176
176
  '0x001B': {
177
- payload: new Buffer('020A', 'hex'),
177
+ payload: Buffer.from('020A', 'hex'),
178
178
  data: { area: 2, sequence: 10 }
179
179
  },
180
180
 
181
181
  // 4.2.3 Read Status of Sequence
182
182
  '0xE014': {
183
- payload: new Buffer('08', 'hex'),
183
+ payload: Buffer.from('08', 'hex'),
184
184
  data: { area: 8 }
185
185
  },
186
186
 
187
187
  // 4.2.4 Response Read Status of Sequence
188
188
  '0xE015': {
189
- payload: new Buffer('08A0', 'hex'),
189
+ payload: Buffer.from('08A0', 'hex'),
190
190
  data: { area: 8, sequence: 160 }
191
191
  },
192
192
 
193
193
  // 4.2.5 Broadcast Status of Sequence
194
194
  '0xF036': {
195
- payload: new Buffer('0A050B370163', 'hex'),
195
+ payload: Buffer.from('0A050B370163', 'hex'),
196
196
  data: { areas: [
197
197
  { number: 1, sequence: 10 },
198
198
  { number: 2, sequence: 5 },
@@ -207,18 +207,18 @@ module.exports = {
207
207
 
208
208
  // 4.3.1 Single Channel Control
209
209
  '0x0031': {
210
- payload: new Buffer('04640190', 'hex'),
210
+ payload: Buffer.from('04640190', 'hex'),
211
211
  data: { channel: 4, level: 100, time: 400 }
212
212
  },
213
213
 
214
214
  // 4.3.2 Response Single Channel Control
215
215
  '0x0032': [
216
216
  {
217
- payload: new Buffer('0AF864', 'hex'),
217
+ payload: Buffer.from('0AF864', 'hex'),
218
218
  data: { channel: 10, level: 100, success: true }
219
219
  },
220
220
  {
221
- payload: new Buffer('06F532', 'hex'),
221
+ payload: Buffer.from('06F532', 'hex'),
222
222
  data: { channel: 6, level: 50, success: false }
223
223
  }
224
224
  ],
@@ -228,7 +228,7 @@ module.exports = {
228
228
 
229
229
  // 4.3.4 Response Read Status of Channels
230
230
  '0x0034': {
231
- payload: new Buffer('06643250006428', 'hex'),
231
+ payload: Buffer.from('06643250006428', 'hex'),
232
232
  data: { channels: [
233
233
  { number: 1, level: 100 },
234
234
  { number: 2, level: 50 },
@@ -244,7 +244,7 @@ module.exports = {
244
244
 
245
245
  // 4.3.6 Response Read Current Level of Channels
246
246
  '0x0039': {
247
- payload: new Buffer('06643250006428', 'hex'),
247
+ payload: Buffer.from('06643250006428', 'hex'),
248
248
  data: { channels: [
249
249
  { number: 1, level: 100 },
250
250
  { number: 2, level: 50 },
@@ -259,32 +259,32 @@ module.exports = {
259
259
 
260
260
  // 5.1.1 Logic Control
261
261
  '0xF116': [
262
- { payload: new Buffer('0100', 'hex'), data: { block: 1, status: false } },
263
- { payload: new Buffer('FA01', 'hex'), data: { block: 250, status: true } },
262
+ { payload: Buffer.from('0100', 'hex'), data: { block: 1, status: false } },
263
+ { payload: Buffer.from('FA01', 'hex'), data: { block: 250, status: true } },
264
264
  ],
265
265
 
266
266
  // 5.1.2 Response Logic Control
267
267
  '0xF117': [
268
- { payload: new Buffer('0201', 'hex'), data: { block: 2, status: true } },
269
- { payload: new Buffer('FB00', 'hex'), data: { block: 251, status: false } },
268
+ { payload: Buffer.from('0201', 'hex'), data: { block: 2, status: true } },
269
+ { payload: Buffer.from('FB00', 'hex'), data: { block: 251, status: false } },
270
270
  ],
271
271
 
272
272
  // 5.1.3 Read Status of Logic Control
273
273
  '0xF112': [
274
- { payload: new Buffer('05', 'hex'), data: { block: 5 } },
275
- { payload: new Buffer('FF', 'hex'), data: { block: 255 } }
274
+ { payload: Buffer.from('05', 'hex'), data: { block: 5 } },
275
+ { payload: Buffer.from('FF', 'hex'), data: { block: 255 } }
276
276
  ],
277
277
 
278
278
  // 5.1.4 Response Read Status of Logic Control
279
279
  '0xF113': [
280
- { payload: new Buffer('0501', 'hex'), data: { block: 5, status: true } },
281
- { payload: new Buffer('F900', 'hex'), data: { block: 249, status: false } },
280
+ { payload: Buffer.from('0501', 'hex'), data: { block: 5, status: true } },
281
+ { payload: Buffer.from('F900', 'hex'), data: { block: 249, status: false } },
282
282
  ],
283
283
 
284
284
  // 5.1.5 Broadcast Status of Status of Logic Control
285
285
  '0xF12F': [
286
- { payload: new Buffer('0101', 'hex'), data: { block: 1, status: true } },
287
- { payload: new Buffer('F501', 'hex'), data: { block: 245, status: true } },
286
+ { payload: Buffer.from('0101', 'hex'), data: { block: 1, status: true } },
287
+ { payload: Buffer.from('F501', 'hex'), data: { block: 245, status: true } },
288
288
  ],
289
289
 
290
290
  // 5.1.6 Read System Date and Time
@@ -292,25 +292,25 @@ module.exports = {
292
292
 
293
293
  // 5.1.7 Response Read System Date and Time
294
294
  '0xDA01': {
295
- payload: new Buffer('F812020C16020E01', 'hex'),
295
+ payload: Buffer.from('F812020C16020E01', 'hex'),
296
296
  data: { success: true, date: new Date(2018, 1, 12, 22, 02, 14) }
297
297
  },
298
298
 
299
299
  // 5.1.8 Modify Read System Date and Time
300
300
  '0xDA02': {
301
- payload: new Buffer('12020C161B1D01', 'hex'),
301
+ payload: Buffer.from('12020C161B1D01', 'hex'),
302
302
  data: { date: new Date(2018, 1, 12, 22, 27, 29) }
303
303
  },
304
304
 
305
305
  // 5.1.9 Response Modify Read System Date and Time
306
306
  '0xDA03': [
307
- { payload: new Buffer('F8', 'hex'), data: { success: true } },
308
- { payload: new Buffer('F5', 'hex'), data: { success: false } },
307
+ { payload: Buffer.from('F8', 'hex'), data: { success: true } },
308
+ { payload: Buffer.from('F5', 'hex'), data: { success: false } },
309
309
  ],
310
310
 
311
311
  // 5.1.10 Broadcast System Date and Time (Every Minute)
312
312
  '0xDA44': {
313
- payload: new Buffer('12020C162C27', 'hex'),
313
+ payload: Buffer.from('12020C162C27', 'hex'),
314
314
  data: { date: new Date(2018, 1, 12, 22, 44, 39) }
315
315
  },
316
316
 
@@ -318,31 +318,31 @@ module.exports = {
318
318
 
319
319
  // 6.1.1 UV Switch Control
320
320
  '0xE01C': [
321
- { payload: new Buffer('10FF', 'hex'), data: { switch: 16, status: true } },
322
- { payload: new Buffer('0500', 'hex'), data: { switch: 5, status: false } }
321
+ { payload: Buffer.from('10FF', 'hex'), data: { switch: 16, status: true } },
322
+ { payload: Buffer.from('0500', 'hex'), data: { switch: 5, status: false } }
323
323
  ],
324
324
 
325
325
  // 6.1.2 Response UV Switch Control
326
326
  '0xE01D': [
327
- { payload: new Buffer('0A01', 'hex'), data: { switch: 10, status: true } },
328
- { payload: new Buffer('0200', 'hex'), data: { switch: 2, status: false } }
327
+ { payload: Buffer.from('0A01', 'hex'), data: { switch: 10, status: true } },
328
+ { payload: Buffer.from('0200', 'hex'), data: { switch: 2, status: false } }
329
329
  ],
330
330
 
331
331
  // 6.1.3 Read Status of UV Switch
332
332
  '0xE018': [
333
- { payload: new Buffer('0A', 'hex'), data: { switch: 10 } },
334
- { payload: new Buffer('05', 'hex'), data: { switch: 5 } }
333
+ { payload: Buffer.from('0A', 'hex'), data: { switch: 10 } },
334
+ { payload: Buffer.from('05', 'hex'), data: { switch: 5 } }
335
335
  ],
336
336
 
337
337
  // 6.1.4 Response Read Status of UV Switch
338
338
  '0xE019': [
339
- { payload: new Buffer('0A01', 'hex'), data: { switch: 10, status: true } },
340
- { payload: new Buffer('0500', 'hex'), data: { switch: 5, status: false } },
339
+ { payload: Buffer.from('0A01', 'hex'), data: { switch: 10, status: true } },
340
+ { payload: Buffer.from('0500', 'hex'), data: { switch: 5, status: false } },
341
341
  ],
342
342
 
343
343
  // 6.1.5 Broadcast Status of Status of UV Switches
344
344
  '0xE017': {
345
- payload: new Buffer('06010001010000', 'hex'),
345
+ payload: Buffer.from('06010001010000', 'hex'),
346
346
  data: { switches: [
347
347
  { number: 1, status: true },
348
348
  { number: 2, status: false },
@@ -357,29 +357,29 @@ module.exports = {
357
357
 
358
358
  // 7.1.1 Curtain Switch Control
359
359
  '0xE3E0': [
360
- { payload: new Buffer('0102', 'hex'), data: { curtain: 1, status: 2 } },
361
- { payload: new Buffer('115A', 'hex'), data: { curtain: 17, status: 90 } }
360
+ { payload: Buffer.from('0102', 'hex'), data: { curtain: 1, status: 2 } },
361
+ { payload: Buffer.from('115A', 'hex'), data: { curtain: 17, status: 90 } }
362
362
  ],
363
363
 
364
364
  // 7.1.2 Response Curtain Switch Control
365
365
  '0xE3E1': [
366
- { payload: new Buffer('0102', 'hex'), data: { curtain: 1, status: 2 } },
367
- { payload: new Buffer('115A', 'hex'), data: { curtain: 17, status: 90 } },
368
- { payload: new Buffer('11EE', 'hex'), data: { curtain: 17, status: 238 } }
366
+ { payload: Buffer.from('0102', 'hex'), data: { curtain: 1, status: 2 } },
367
+ { payload: Buffer.from('115A', 'hex'), data: { curtain: 17, status: 90 } },
368
+ { payload: Buffer.from('11EE', 'hex'), data: { curtain: 17, status: 238 } }
369
369
  ],
370
370
 
371
371
  // 7.1.3 Read Status of Curtain Switch
372
- '0xE3E2': { payload: new Buffer('04', 'hex'), data: { curtain: 4 } },
372
+ '0xE3E2': { payload: Buffer.from('04', 'hex'), data: { curtain: 4 } },
373
373
 
374
374
  // 7.1.4 Response Read Status of Curtain Switch
375
375
  '0xE3E3': [
376
- { payload: new Buffer('0102', 'hex'), data: { curtain: 1, status: 2 } },
377
- { payload: new Buffer('115A', 'hex'), data: { curtain: 17, status: 90 } }
376
+ { payload: Buffer.from('0102', 'hex'), data: { curtain: 1, status: 2 } },
377
+ { payload: Buffer.from('115A', 'hex'), data: { curtain: 17, status: 90 } }
378
378
  ],
379
379
 
380
380
  // 7.1.5 Broadcast Status of Status of Curtain Switches
381
381
  '0xE3E4': {
382
- payload: new Buffer('00000201', 'hex'),
382
+ payload: Buffer.from('00000201', 'hex'),
383
383
  data: { curtains: [
384
384
  { number: 1, level: 0, status: 2 },
385
385
  { number: 2, level: 0, status: 1 }
@@ -390,26 +390,26 @@ module.exports = {
390
390
 
391
391
  // 9.1.1 Panel Control
392
392
  '0xE3D8': [
393
- { payload: new Buffer('0D64', 'hex'), data: { key: 13, value: 100 } },
394
- { payload: new Buffer('0E32', 'hex'), data: { key: 14, value: 50 } },
393
+ { payload: Buffer.from('0D64', 'hex'), data: { key: 13, value: 100 } },
394
+ { payload: Buffer.from('0E32', 'hex'), data: { key: 14, value: 50 } },
395
395
  ],
396
396
 
397
397
  // 9.1.2 Response Panel Control
398
398
  '0xE3D9': [
399
- { payload: new Buffer('0D64', 'hex'), data: { key: 13, value: 100 } },
400
- { payload: new Buffer('0E32', 'hex'), data: { key: 14, value: 50 } },
399
+ { payload: Buffer.from('0D64', 'hex'), data: { key: 13, value: 100 } },
400
+ { payload: Buffer.from('0E32', 'hex'), data: { key: 14, value: 50 } },
401
401
  ],
402
402
 
403
403
  // 9.1.3 Read Status of Panel Control
404
404
  '0xE3DA': [
405
- { payload: new Buffer('0D', 'hex'), data: { key: 13 } },
406
- { payload: new Buffer('0E', 'hex'), data: { key: 14 } }
405
+ { payload: Buffer.from('0D', 'hex'), data: { key: 13 } },
406
+ { payload: Buffer.from('0E', 'hex'), data: { key: 14 } }
407
407
  ],
408
408
 
409
409
  // 9.1.4 Response Read Status of Panel Control
410
410
  '0xE3DB': [
411
- { payload: new Buffer('0D64', 'hex'), data: { key: 13, value: 100 } },
412
- { payload: new Buffer('0E32', 'hex'), data: { key: 14, value: 50 } },
411
+ { payload: Buffer.from('0D64', 'hex'), data: { key: 13, value: 100 } },
412
+ { payload: Buffer.from('0E32', 'hex'), data: { key: 14, value: 50 } },
413
413
  ],
414
414
 
415
415
  /* 10. AC Control */
@@ -422,7 +422,7 @@ module.exports = {
422
422
 
423
423
  // 10.1.3 Control AC Status
424
424
  '0x193A': {
425
- payload: new Buffer('01001C10131516230101001311', 'hex'),
425
+ payload: Buffer.from('01001C10131516230101001311', 'hex'),
426
426
  data: {
427
427
  ac: 1,
428
428
  temperature: {
@@ -452,7 +452,7 @@ module.exports = {
452
452
 
453
453
  // 10.1.4 Response Control AC Status
454
454
  '0x193B': {
455
- payload: new Buffer('01001C10131516010100001000', 'hex'),
455
+ payload: Buffer.from('01001C10131516010100001000', 'hex'),
456
456
  data: {
457
457
  ac: 1,
458
458
  temperature: {
@@ -488,7 +488,7 @@ module.exports = {
488
488
  // 11.1.2 Response Read Floor Heating Status
489
489
  '0x1945': [
490
490
  {
491
- payload: new Buffer('001800011414141401', 'hex'),
491
+ payload: Buffer.from('001800011414141401', 'hex'),
492
492
  data: {
493
493
  temperature: {
494
494
  type: 0,
@@ -504,7 +504,7 @@ module.exports = {
504
504
  }
505
505
  },
506
506
  {
507
- payload: new Buffer('0018000114141414', 'hex'),
507
+ payload: Buffer.from('0018000114141414', 'hex'),
508
508
  data: {
509
509
  temperature: {
510
510
  type: 0,
@@ -522,7 +522,7 @@ module.exports = {
522
522
 
523
523
  // 11.1.3 Control Floor Heating Status
524
524
  '0x1946': {
525
- payload: new Buffer('00010116161412', 'hex'),
525
+ payload: Buffer.from('00010116161412', 'hex'),
526
526
  data: {
527
527
  temperature: {
528
528
  type: 0,
@@ -538,7 +538,7 @@ module.exports = {
538
538
 
539
539
  // 11.1.4 Response Control Floor Heating Status
540
540
  '0x1947': {
541
- payload: new Buffer('F800010116161412', 'hex'),
541
+ payload: Buffer.from('F800010116161412', 'hex'),
542
542
  data: {
543
543
  success: true,
544
544
  temperature: {
@@ -557,13 +557,13 @@ module.exports = {
557
557
 
558
558
  // 11.2.1 Read Floor Heating Status
559
559
  '0x1C5E': [
560
- { payload: new Buffer('01', 'hex'), data: { channel: 1 } },
561
- { payload: new Buffer('0A', 'hex'), data: { channel: 10 } },
560
+ { payload: Buffer.from('01', 'hex'), data: { channel: 1 } },
561
+ { payload: Buffer.from('0A', 'hex'), data: { channel: 10 } },
562
562
  ],
563
563
 
564
564
  // 11.2.2 Response Read Floor Heating Status
565
565
  '0x1C5F': {
566
- payload: new Buffer('012100021818161400011E010A', 'hex'),
566
+ payload: Buffer.from('012100021818161400011E010A', 'hex'),
567
567
  data: {
568
568
  channel: 1,
569
569
  work: { type: 2, status: true },
@@ -578,7 +578,7 @@ module.exports = {
578
578
 
579
579
  // 11.2.3 Control Floor Heating Status
580
580
  '0x1C5C': {
581
- payload: new Buffer('0121000218181614010A', 'hex'),
581
+ payload: Buffer.from('0121000218181614010A', 'hex'),
582
582
  data: {
583
583
  channel: 1,
584
584
  work: { type: 2, status: true },
@@ -591,7 +591,7 @@ module.exports = {
591
591
 
592
592
  // 11.2.4 Response Control Floor Heating Status
593
593
  '0x1C5D': {
594
- payload: new Buffer('0121000218181614010A', 'hex'),
594
+ payload: Buffer.from('0121000218181614010A', 'hex'),
595
595
  data: {
596
596
  channel: 1,
597
597
  work: { type: 2, status: true },
@@ -606,13 +606,13 @@ module.exports = {
606
606
 
607
607
  // 12.1.1 Read Sensors Status
608
608
  '0xDB00': [
609
- { payload: new Buffer('01', 'hex'), data: { logic: 1 } },
610
- { payload: new Buffer('18', 'hex'), data: { logic: 24 } },
609
+ { payload: Buffer.from('01', 'hex'), data: { logic: 1 } },
610
+ { payload: Buffer.from('18', 'hex'), data: { logic: 24 } },
611
611
  ],
612
612
 
613
613
  // 12.1.2 Response Read Sensors Status
614
614
  '0xDB01': {
615
- payload: new Buffer('010000010000012C', 'hex'),
615
+ payload: Buffer.from('010000010000012C', 'hex'),
616
616
  data: {
617
617
  movement: true,
618
618
  delay: 300,
@@ -631,7 +631,7 @@ module.exports = {
631
631
  // 12.2.2 Response Read Sensors Status
632
632
  '0x1646': [
633
633
  {
634
- payload: new Buffer('F82D016A000000', 'hex'),
634
+ payload: Buffer.from('F82D016A000000', 'hex'),
635
635
  data: {
636
636
  success: true,
637
637
  temperature: 25,
@@ -644,7 +644,7 @@ module.exports = {
644
644
  }
645
645
  },
646
646
  {
647
- payload: new Buffer('F82D016A01010000', 'hex'),
647
+ payload: Buffer.from('F82D016A01010000', 'hex'),
648
648
  data: {
649
649
  success: true,
650
650
  temperature: 25,
@@ -665,7 +665,7 @@ module.exports = {
665
665
 
666
666
  // 12.3.3 Broadcast Sensors Status Automatically
667
667
  '0x1647': {
668
- payload: new Buffer('2D03F701000001', 'hex'),
668
+ payload: Buffer.from('2D03F701000001', 'hex'),
669
669
  data: {
670
670
  temperature: 25,
671
671
  brightness: 1015,
@@ -685,7 +685,7 @@ module.exports = {
685
685
 
686
686
  // 12.4.2 Response Read Sensors Status
687
687
  '0x1605': {
688
- payload: new Buffer('F82C0108280000010100', 'hex'),
688
+ payload: Buffer.from('F82C0108280000010100', 'hex'),
689
689
  data: {
690
690
  success: true,
691
691
  temperature: 24,
@@ -703,7 +703,7 @@ module.exports = {
703
703
 
704
704
  // 12.4.3 Broadcast Sensors Status
705
705
  '0x1630': {
706
- payload: new Buffer('F82C01080000010100', 'hex'),
706
+ payload: Buffer.from('F82C01080000010100', 'hex'),
707
707
  data: {
708
708
  success: true,
709
709
  temperature: 24,
@@ -722,22 +722,22 @@ module.exports = {
722
722
 
723
723
  // 13.1.1 Read Temperature
724
724
  '0xE3E7': [
725
- { payload: new Buffer('01', 'hex'), data: { channel: 1 } },
726
- { payload: new Buffer('FF', 'hex'), data: { channel: 255 } }
725
+ { payload: Buffer.from('01', 'hex'), data: { channel: 1 } },
726
+ { payload: Buffer.from('FF', 'hex'), data: { channel: 255 } }
727
727
  ],
728
728
 
729
729
  // 13.1.2 Response Read Temperature
730
730
  '0xE3E8': [
731
731
  {
732
- payload: new Buffer('0100', 'hex'),
732
+ payload: Buffer.from('0100', 'hex'),
733
733
  data: { channel: 1, temperature: 0 }
734
734
  },
735
735
  {
736
- payload: new Buffer('0116', 'hex'),
736
+ payload: Buffer.from('0116', 'hex'),
737
737
  data: { channel: 1, temperature: 22 }
738
738
  },
739
739
  {
740
- payload: new Buffer('018F', 'hex'),
740
+ payload: Buffer.from('018F', 'hex'),
741
741
  data: { channel: 1, temperature: -15 }
742
742
  },
743
743
  ],
@@ -745,19 +745,19 @@ module.exports = {
745
745
  // 13.1.3 Broadcast Temperature
746
746
  '0xE3E5': [
747
747
  {
748
- payload: new Buffer('0189', 'hex'),
748
+ payload: Buffer.from('0189', 'hex'),
749
749
  data: { channel: 1, temperature: -9 }
750
750
  },
751
751
  {
752
- payload: new Buffer('0100', 'hex'),
752
+ payload: Buffer.from('0100', 'hex'),
753
753
  data: { channel: 1, temperature: 0 }
754
754
  },
755
755
  {
756
- payload: new Buffer('0105', 'hex'),
756
+ payload: Buffer.from('0105', 'hex'),
757
757
  data: { channel: 1, temperature: 5 }
758
758
  },
759
759
  {
760
- payload: new Buffer('0119', 'hex'),
760
+ payload: Buffer.from('0119', 'hex'),
761
761
  data: { channel: 1, temperature: 25 }
762
762
  }
763
763
  ],
@@ -766,47 +766,65 @@ module.exports = {
766
766
 
767
767
  // 13.2.1 Read Temperature New
768
768
  '0x1948': {
769
- payload: new Buffer('01', 'hex'),
769
+ payload: Buffer.from('01', 'hex'),
770
770
  data: { channel: 1 }
771
771
  },
772
772
 
773
773
  // 13.2.2 Response Temperature
774
774
  '0x1949': [
775
775
  {
776
- payload: new Buffer('019A99C141', 'hex'),
776
+ payload: Buffer.from('019A99C141', 'hex'),
777
777
  data: { channel: 1, temperature: 24.200000762939453 }
778
778
  },
779
779
  {
780
- payload: new Buffer('010000B441', 'hex'),
780
+ payload: Buffer.from('010000B441', 'hex'),
781
781
  data: { channel: 1, temperature: 22.5 }
782
782
  }
783
783
  ],
784
784
 
785
+ // 16.1.3 Read Dry Contact Status
786
+ '0x15CE': {
787
+ payload: Buffer.from('0102', 'hex'),
788
+ data: { area: 1, switch: 2 }
789
+ },
790
+
791
+ // 16.1.4 Response Read Dry Contact Status
792
+ '0x15CF': [
793
+ {
794
+ payload: Buffer.from('010201', 'hex'),
795
+ data: { area: 1, switch: 2, contact: true }
796
+ },
797
+ {
798
+ payload: Buffer.from('010100', 'hex'),
799
+ data: { area: 1, switch: 1, contact: false }
800
+ }
801
+ ],
802
+
785
803
  /* XX. Undocumented Operation Codes */
786
804
 
787
805
  // XX.1 Panel
788
806
 
789
807
  // XX.1.1 Panel brightness/lock
790
808
  '0xE012': {
791
- payload: new Buffer('140101', 'hex'),
809
+ payload: Buffer.from('140101', 'hex'),
792
810
  data: { backlight: 20, statusLights: 1, autoLock: 1 }
793
811
  },
794
812
 
795
813
  // XX.1.2 Panel brighness/lock Response
796
814
  '0xE013': [
797
815
  {
798
- payload: new Buffer('F8', 'hex'),
816
+ payload: Buffer.from('F8', 'hex'),
799
817
  data: { success: true }
800
818
  },
801
819
  {
802
- payload: new Buffer('F5', 'hex'),
820
+ payload: Buffer.from('F5', 'hex'),
803
821
  data: { success: false }
804
822
  }
805
823
  ],
806
824
 
807
825
  // XX.1.3 Panel button color
808
826
  '0xE14E': {
809
- payload: new Buffer('04681766FFFFFF', 'hex'),
827
+ payload: Buffer.from('04681766FFFFFF', 'hex'),
810
828
  data: {
811
829
  button: 4,
812
830
  color: {
@@ -818,7 +836,7 @@ module.exports = {
818
836
 
819
837
  // XX.1.4 Panel button color Response,
820
838
  '0xE14F': {
821
- payload: new Buffer('04', 'hex'),
839
+ payload: Buffer.from('04', 'hex'),
822
840
  data: { button: 4 }
823
841
  }
824
842
  };