node-red-contrib-homebridge-automation 0.1.12-beta.23 → 0.1.12-beta.25

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-homebridge-automation",
3
- "version": "0.1.12-beta.23",
3
+ "version": "0.1.12-beta.25",
4
4
  "description": "NodeRED Automation for HomeBridge",
5
5
  "main": "src/HAP-NodeRed.js",
6
6
  "scripts": {
@@ -11,10 +11,7 @@ const HbStatusNode = require('./hbStatusNode');
11
11
  const HapDeviceRoutes = require('./HapDeviceRoutes');
12
12
 
13
13
  module.exports = function (RED) {
14
- var evDevices = [];
15
- var ctDevices = [];
16
14
  var hbDevices;
17
- var homebridge;
18
15
 
19
16
  /**
20
17
  * hbConf - Configuration
package/src/hbBaseNode.js CHANGED
@@ -24,18 +24,32 @@ class HbBaseNode {
24
24
  this.on('input', this.handleInput.bind(this));
25
25
  }
26
26
  this.on('close', this.handleClose.bind(this));
27
- this.hbConfigNode.on('event', this.handleHBEventMessage.bind(this));
28
- this.on('topic', this.handleHBTopicMessage.bind(this));
27
+ this.on('hbEvent', this.handleHBEventMessage.bind(this));
29
28
  }
30
29
 
31
30
  handleHBEventMessage(service) {
32
- debug('event for', this.id, service.serviceName, service.values);
33
- }
31
+ debug('hbEvent for', this.id, service.serviceName, service.values);
34
32
 
35
- handleHBTopicMessage(service) {
36
- debug('topic for', this.id, service.serviceName, service.values);
33
+ this.status({
34
+ text: JSON.stringify(service.values),
35
+ shape: 'dot',
36
+ fill: 'green',
37
+ });
38
+ this.send({ payload: service.values });
37
39
  }
38
40
 
41
+ createMessage(event, isInitialState = false) {
42
+ return {
43
+ name: this.node.name,
44
+ payload: this.state,
45
+ Homebridge: this.node.hbDevice.homebridge,
46
+ Manufacturer: this.node.hbDevice.manufacturer,
47
+ Service: this.node.hbDevice.deviceType,
48
+ _device: this.node.device,
49
+ _confId: this.node.confId,
50
+ _rawEvent: isInitialState ? event : undefined,
51
+ };
52
+ }
39
53
 
40
54
  registerNode() {
41
55
  debug("Registering node:", this.fullName);
@@ -1,13 +1,10 @@
1
- // const EventEmitter = require('events'); // Import EventEmitter
2
1
  const { HapClient } = require('@homebridge/hap-client');
3
2
  const debug = require('debug')('hapNodeRed:hbConfigNode');
4
3
  const { Log } = require('./lib/logger.js');
5
4
  const Queue = require('better-queue');
6
5
 
7
- class HBConfigNode { // Extend EventEmitter
6
+ class HBConfigNode {
8
7
  constructor(config, RED) {
9
- // super(); // Call EventEmitter's constructor
10
-
11
8
  if (!config.jest) {
12
9
  RED.nodes.createNode(this, config);
13
10
 
@@ -41,10 +38,7 @@ class HBConfigNode { // Extend EventEmitter
41
38
  this.waitForNoMoreDiscoveries();
42
39
  this.hapClient.on('instance-discovered', this.waitForNoMoreDiscoveries);
43
40
 
44
- this.on('close', () => {
45
- debug('close');
46
- this.close();
47
- });
41
+ this.on('close', this.close.bind(this));
48
42
  }
49
43
  }
50
44
 
@@ -70,19 +64,16 @@ class HBConfigNode { // Extend EventEmitter
70
64
  }
71
65
 
72
66
  toList(perms) {
73
- const supportedServiceType = (service) => {
74
- const supportedTypes = [
75
- 'Battery', 'Carbon Dioxide Sensor', 'Carbon Monoxide Sensor', 'Doorbell',
76
- 'Fan', 'Fanv2', 'Garage Door Opener', 'Humidity Sensor', 'Input Source',
77
- 'Leak Sensor', 'Lightbulb', 'Lock Mechanism', 'Motion Sensor', 'Occupancy Sensor',
78
- 'Outlet', 'Smoke Sensor', 'Speaker', 'Stateless Programmable Switch', 'Switch',
79
- 'Television', 'Temperature Sensor', 'Thermostat', 'Contact Sensor',
80
- ];
81
- return supportedTypes.includes(service.humanType);
82
- };
67
+ const supportedTypes = [
68
+ 'Battery', 'Carbon Dioxide Sensor', 'Carbon Monoxide Sensor', 'Doorbell',
69
+ 'Fan', 'Fanv2', 'Garage Door Opener', 'Humidity Sensor', 'Input Source',
70
+ 'Leak Sensor', 'Lightbulb', 'Lock Mechanism', 'Motion Sensor', 'Occupancy Sensor',
71
+ 'Outlet', 'Smoke Sensor', 'Speaker', 'Stateless Programmable Switch', 'Switch',
72
+ 'Television', 'Temperature Sensor', 'Thermostat', 'Contact Sensor',
73
+ ];
83
74
 
84
75
  return this.hbDevices
85
- .filter(service => supportedServiceType(service))
76
+ .filter(service => supportedTypes.includes(service.humanType))
86
77
  .map(service => ({
87
78
  name: service.serviceName,
88
79
  fullName: `${service.serviceName} - ${service.type}`,
@@ -126,53 +117,34 @@ class HBConfigNode { // Extend EventEmitter
126
117
  debug('_Register %s -> %s', clientNode.type, clientNode.name);
127
118
  clientNode.hbDevice = this.hbDevices.find(service => {
128
119
  const deviceUnique = `${service.instance.name}${service.instance.username}${service.accessoryInformation.Manufacturer}${service.serviceName}${service.uuid.slice(0, 8)}`;
129
- clientNode.status({ fill: 'green', shape: 'dot', text: 'connected' });
120
+ if (clientNode.device === deviceUnique) {
121
+ clientNode.status({ fill: 'green', shape: 'dot', text: 'connected' });
122
+ clientNode.emit('hbReady', service);
123
+ }
130
124
  return clientNode.device === deviceUnique;
131
125
  });
132
126
 
133
- debug(clientNode.type);
134
127
  if (clientNode.config.type === 'hb-status') {
135
- debug('Adding', clientNode.name, clientNode.device)
136
128
  this.monitorNodes[clientNode.device] = clientNode.hbDevice;
137
129
  }
138
- console.log(this.monitorNodes);
130
+
139
131
  if (!clientNode.hbDevice) {
140
132
  console.error('ERROR: _register - HB Device Missing', clientNode.name);
141
133
  }
142
134
  }
143
- debug(`Registering ${Object.keys(this.monitorNodes).length} nodes for events`);
144
- // console.log(Object.keys(this.monitorNodes));
135
+
145
136
  if (Object.keys(this.monitorNodes).length) {
146
- debug(`Registering ${Object.keys(this.monitorNodes).length} nodes for events`);
147
137
  this.monitor = await this.hapClient.monitorCharacteristics(Object.values(this.monitorNodes));
148
138
  this.monitor.on('service-update', (services) => {
149
- // Emit events for updated services
150
139
  for (const service of services) {
151
- debug(`${service.instance.name}${service.instance.username}${service.accessoryInformation.Manufacturer}${service.serviceName}${service.uuid.slice(0, 8)}`,
152
- service.values)
153
- this.emit(
154
- `${service.instance.name}${service.instance.username}${service.accessoryInformation.Manufacturer}${service.serviceName}${service.uuid.slice(0, 8)}`,
155
- service.values
156
- );
157
- debug('event',
158
- service.serviceName, service.values)
159
- this.emit(
160
- 'event',
161
- service
162
- );
163
- // console.log(this.clientNodes);
164
-
165
140
  const eventNodes = Object.values(this.clientNodes).filter(
166
-
167
- (clientNode) =>
141
+ clientNode =>
168
142
  clientNode.config.device === `${service.instance.name}${service.instance.username}${service.accessoryInformation.Manufacturer}${service.serviceName}${service.uuid.slice(0, 8)}`
169
-
170
143
  );
171
- console.log('eventNodes, ', eventNodes);
144
+
172
145
  eventNodes.forEach((eventNode) => {
173
- debug('emit', eventNode.name, eventNode.type)
174
146
  if (eventNode._events && typeof eventNode.emit === 'function') {
175
- eventNode.emit('topic', service);
147
+ eventNode.emit('hbEvent', service);
176
148
  }
177
149
  });
178
150
  }
@@ -182,11 +154,7 @@ class HBConfigNode { // Extend EventEmitter
182
154
  }
183
155
 
184
156
  deregister(clientNode) {
185
- clientNode.status({
186
- text: 'disconnected',
187
- shape: 'ring',
188
- fill: 'red',
189
- });
157
+ clientNode.status({ text: 'disconnected', shape: 'ring', fill: 'red' });
190
158
  delete this.clientNodes[clientNode.id];
191
159
  }
192
160
 
@@ -3,87 +3,21 @@ const debug = require('debug')('hapNodeRed:hbEventNode');
3
3
 
4
4
  class HbEventNode extends hbBaseNode {
5
5
  constructor(config, RED) {
6
- // console.log('HbEventNode', config);
7
6
  super(config, RED);
8
7
  this.sendInitialState = config.sendInitialState === true;
9
- this.hbConfigNode.register(this.config, this.registerNode.bind(this));
8
+ this.on('hbReady', this.handleHbReady.bind(this))
10
9
  }
11
10
 
12
- // Handle event command processing
13
- command(event) {
14
- if (event.status === true && event.value !== undefined) {
15
- this.state = { ...this.state, ...this._convertHBcharacteristicToNode([event]) };
16
- const msg = this.createMessage(event);
17
- this.updateStatus({ text: `${JSON.stringify(msg.payload).slice(0, 30)}...`, shape: 'dot', fill: 'green' });
18
- this.send(msg);
19
- } else if (event.status === true) {
20
- this.updateStatus({ text: 'connected', shape: 'dot', fill: 'green' });
21
- } else {
22
- this.updateStatus({ text: `disconnected: ${event.status}`, shape: 'ring', fill: 'red' });
23
- }
24
- }
25
-
26
- // Handle device registration logic
27
- handleDeviceRegistration() {
28
- debug('hbEvent.register', this);
29
- this.node.hbDevice = this.findDevice(this.node.device, { perms: 'pr' });
30
-
31
- if (this.node.hbDevice) {
32
- this.registerEventHandlers();
33
- this.fetchInitialState();
34
- } else {
35
- this.node.error(`Can't find device ${this.node.device}`);
36
- }
37
- }
38
-
39
- // Register for device events
40
- registerEventHandlers() {
41
- this.node.deviceType = this.node.hbDevice.deviceType;
42
- this.node.listener = this.command;
43
- this.node.eventName = [];
44
-
45
- this.node.hbDevice.eventRegisters.forEach((event) => {
46
- this.registerEvent(this.node.hbDevice.id + event.aid + event.iid);
47
- });
48
-
49
- this.updateStatus({ text: 'connected', shape: 'dot', fill: 'green' });
50
- }
51
-
52
- // Fetch and send initial state if required
53
- fetchInitialState() {
54
- this.fetchStatus(this.node.device, { perms: 'ev' }, (err, message) => {
55
- if (!err) {
56
- this.state = this._convertHBcharacteristicToNode(message.characteristics);
57
- debug(
58
- 'hbEvent received: %s = %s',
59
- this.node.fullName,
60
- `${JSON.stringify(message.characteristics).slice(0, 80)}...`
61
- );
62
-
63
- if (this.sendInitialState) {
64
- const msg = this.createMessage(message, true);
65
- this.updateStatus({ text: `${JSON.stringify(msg.payload).slice(0, 30)}...`, shape: 'dot', fill: 'green' });
66
- this.send(msg);
67
- }
68
- } else {
69
- this.node.error('hbEvent _status: error', this.node.fullName, err);
70
- }
11
+ handleHbReady(service) {
12
+ this.status({
13
+ text: JSON.stringify(service.values),
14
+ shape: 'dot',
15
+ fill: 'green',
71
16
  });
17
+ this.send({ payload: service.values });
72
18
  }
73
-
74
19
  // Create a message payload for event or initial state
75
- createMessage(event, isInitialState = false) {
76
- return {
77
- name: this.node.name,
78
- payload: this.state,
79
- Homebridge: this.node.hbDevice.homebridge,
80
- Manufacturer: this.node.hbDevice.manufacturer,
81
- Service: this.node.hbDevice.deviceType,
82
- _device: this.node.device,
83
- _confId: this.node.confId,
84
- _rawEvent: isInitialState ? event : undefined,
85
- };
86
- }
20
+
87
21
  }
88
22
 
89
23
  module.exports = HbEventNode;
@@ -19,10 +19,21 @@ class HbResumeNode extends HbBaseNode {
19
19
  // Handle device registration
20
20
  debug('hbResume - hbConfigNode', this.hbConfigNode);
21
21
  // debug('hbResume - hbConfigNode', this.configNode.hbConfigNode);
22
- this.hbConfigNode.register(this.config, this.registerNode.bind(this));
22
+
23
+ }
24
+
25
+ handleHBEventMessage(service) {
26
+ debug('topic for', this.id, service.serviceName, service.values);
27
+
28
+ this.status({
29
+ text: JSON.stringify(service.values),
30
+ shape: 'dot',
31
+ fill: 'green',
32
+ });
33
+ this.send({ payload: service.values });
23
34
  }
24
35
 
25
- handleInput(msg) {
36
+ handleInput(msg, send) {
26
37
  this.msg = msg;
27
38
  debug("hbResume.input: %s input", this.fullName, JSON.stringify(msg));
28
39
 
@@ -51,7 +62,7 @@ class HbResumeNode extends HbBaseNode {
51
62
  newMsg = msg;
52
63
  }
53
64
 
54
- this.send(newMsg.payload.On ? newMsg : { ...newMsg, payload: { On: false } });
65
+ send(newMsg.payload.On ? newMsg : { ...newMsg, payload: { On: false } });
55
66
  debug("hbResume.input: %s output", this.fullName, JSON.stringify(newMsg));
56
67
  this.updateStatus(newMsg.payload);
57
68
  this.lastMessageValue = newMsg.payload;
@@ -6,7 +6,7 @@ class HbStatusNode extends HbBaseNode {
6
6
  super(config, RED);
7
7
  }
8
8
 
9
- async handleInput(message) {
9
+ async handleInput(message, send) {
10
10
  debug('handleInput', message.payload, this.name);
11
11
 
12
12
  if (!this.hbDevice) {
@@ -23,7 +23,7 @@ class HbStatusNode extends HbBaseNode {
23
23
  });
24
24
 
25
25
  message.payload = result.values;
26
- this.send(message);
26
+ send(message);
27
27
  }
28
28
  }
29
29
 
@@ -95,48 +95,10 @@
95
95
  ]
96
96
  ]
97
97
  },
98
- {
99
- "id": "696e04753d952daf",
100
- "type": "hb-status",
101
- "z": "caef1e7b5b399e80",
102
- "d": true,
103
- "name": "West Bedroom",
104
- "Homebridge": "homebridge",
105
- "Manufacturer": "Tasmota",
106
- "Service": "Lightbulb",
107
- "device": "homebridge1C:22:3D:E3:CF:34TasmotaWest Bedroom00000043",
108
- "conf": "557aec8e8c47e61e",
109
- "x": 480,
110
- "y": 300,
111
- "wires": [
112
- [
113
- "a866ae0bb24ce682"
114
- ]
115
- ]
116
- },
117
- {
118
- "id": "bb88544904b343a1",
119
- "type": "hb-event",
120
- "z": "caef1e7b5b399e80",
121
- "d": true,
122
- "name": "",
123
- "Homebridge": "homebridge",
124
- "Manufacturer": "Tasmota",
125
- "Service": "Lightbulb",
126
- "device": "homebridge1C:22:3D:E3:CF:34TasmotaWest Bedroom00000043",
127
- "conf": "557aec8e8c47e61e",
128
- "sendInitialState": false,
129
- "x": 250,
130
- "y": 380,
131
- "wires": [
132
- []
133
- ]
134
- },
135
98
  {
136
99
  "id": "452e3e6171aa7a25",
137
100
  "type": "hb-resume",
138
101
  "z": "caef1e7b5b399e80",
139
- "d": true,
140
102
  "name": "West Bedroom",
141
103
  "Homebridge": "homebridge",
142
104
  "Manufacturer": "Tasmota",
@@ -179,7 +141,7 @@
179
141
  "device": "homebridge1C:22:3D:E3:CF:34TasmotaWest Bedroom Fan00000040",
180
142
  "conf": "557aec8e8c47e61e",
181
143
  "outputs": 0,
182
- "x": 510,
144
+ "x": 810,
183
145
  "y": 600,
184
146
  "wires": []
185
147
  },
@@ -223,8 +185,8 @@
223
185
  "device": "homebridge1C:22:3D:E3:CF:34TasmotaWest Bedroom00000043",
224
186
  "conf": "557aec8e8c47e61e",
225
187
  "outputs": 0,
226
- "x": 740,
227
- "y": 660,
188
+ "x": 800,
189
+ "y": 680,
228
190
  "wires": []
229
191
  },
230
192
  {
@@ -401,5 +363,82 @@
401
363
  "6703815a8874b156"
402
364
  ]
403
365
  ]
366
+ },
367
+ {
368
+ "id": "80ffdbb93cd24b48",
369
+ "type": "inject",
370
+ "z": "caef1e7b5b399e80",
371
+ "name": "",
372
+ "props": [
373
+ {
374
+ "p": "payload"
375
+ },
376
+ {
377
+ "p": "topic",
378
+ "vt": "str"
379
+ }
380
+ ],
381
+ "repeat": "",
382
+ "crontab": "",
383
+ "once": false,
384
+ "onceDelay": 0.1,
385
+ "topic": "",
386
+ "payload": "{\"On\": true}",
387
+ "payloadType": "json",
388
+ "x": 150,
389
+ "y": 340,
390
+ "wires": [
391
+ [
392
+ "452e3e6171aa7a25"
393
+ ]
394
+ ]
395
+ },
396
+ {
397
+ "id": "d0e413b3c28f757a",
398
+ "type": "inject",
399
+ "z": "caef1e7b5b399e80",
400
+ "name": "",
401
+ "props": [
402
+ {
403
+ "p": "payload"
404
+ },
405
+ {
406
+ "p": "topic",
407
+ "vt": "str"
408
+ }
409
+ ],
410
+ "repeat": "",
411
+ "crontab": "",
412
+ "once": false,
413
+ "onceDelay": 0.1,
414
+ "topic": "",
415
+ "payload": "{\"On\": false}",
416
+ "payloadType": "json",
417
+ "x": 150,
418
+ "y": 400,
419
+ "wires": [
420
+ [
421
+ "452e3e6171aa7a25"
422
+ ]
423
+ ]
424
+ },
425
+ {
426
+ "id": "82638dac6ac32bb1",
427
+ "type": "hb-event",
428
+ "z": "caef1e7b5b399e80",
429
+ "name": "West Bedroom",
430
+ "Homebridge": "homebridge",
431
+ "Manufacturer": "Tasmota",
432
+ "Service": "Lightbulb",
433
+ "device": "homebridge1C:22:3D:E3:CF:34TasmotaWest Bedroom00000043",
434
+ "conf": "557aec8e8c47e61e",
435
+ "sendInitialState": true,
436
+ "x": 500,
437
+ "y": 260,
438
+ "wires": [
439
+ [
440
+ "a866ae0bb24ce682"
441
+ ]
442
+ ]
404
443
  }
405
444
  ]
package/src/hbDevices.js DELETED
@@ -1,10 +0,0 @@
1
- const { Homebridges } = require('./lib/Homebridges.js');
2
- const HAPNodeJSClient = require('hap-node-client').HAPNodeJSClient;
3
-
4
- class hbDevices {
5
-
6
-
7
-
8
- }
9
-
10
- modules.export = hbDevices;
@@ -1,126 +0,0 @@
1
- var debug = require('debug')('Accessory');
2
- var Service = require('./Service.js').Service;
3
-
4
- module.exports = {
5
- Accessory: Accessory
6
- };
7
-
8
- /*
9
- * Homebridges -> Homebridge -> Accessory -> Service -> Characteristic
10
- */
11
-
12
- function Accessory(devices, context) {
13
- // debug("Accessory", devices);
14
- this.aid = devices.aid;
15
- this.host = context.host;
16
- this.port = context.port;
17
- this.homebridge = context.homebridge;
18
- this.id = context.id;
19
- this.services = [];
20
- devices.services.forEach(function (element) {
21
- // debug("Service", element);
22
- switch (element.type.substring(0, 8)) {
23
- case "0000003E": // Accessory Information
24
- this.info = information(element.characteristics);
25
- break;
26
- case "00000110": // Camera RTPStream Management generates duplicates
27
- var service = new Service(element, this);
28
- // console.log('services', this.services);
29
- if (this.services.some(e => e.type === '00000110')) {
30
-
31
- } else {
32
- this.services.push(service);
33
- }
34
- break;
35
- case "000000D9": // Input Source from webosTV has a dummy input source
36
- var service = new Service(element, this);
37
- if (service.name !== "dummy") {
38
- this.services.push(service);
39
- }
40
- break;
41
- default:
42
- var service = new Service(element, this);
43
- this.services.push(service);
44
- }
45
- }.bind(this));
46
- // debug("Info", this.info);
47
- }
48
-
49
- Accessory.prototype.toList = function (context) {
50
- var list = [];
51
- // debug("toList", context);
52
- context.aid = this.aid;
53
- if (!this.info) {
54
- console.log("ERROR: incorrect version of plugin, please upgrade");
55
- }
56
- context.name = this.info.Name;
57
- context.manufacturer = this.info.Manufacturer;
58
- for (var index in this.services) {
59
- var service = this.services[index].toList(context);
60
- if (service) {
61
- list = list.concat(service);
62
- }
63
- }
64
-
65
- // debug('toList', new Error('test'));
66
- // debug("opt",context.opt,list.length);
67
- return (list);
68
- };
69
-
70
- /*
71
- [ { iid: 2,
72
- type: '00000014-0000-1000-8000-0026BB765291',
73
- perms: [Array],
74
- format: 'bool',
75
- description: 'Identify' },
76
- { iid: 3,
77
- type: '00000020-0000-1000-8000-0026BB765291',
78
- perms: [Array],
79
- format: 'string',
80
- value: 'NorthernMan54',
81
- description: 'Manufacturer' },
82
- { iid: 4,
83
- type: '00000021-0000-1000-8000-0026BB765291',
84
- perms: [Array],
85
- format: 'string',
86
- value: 'dht22',
87
- description: 'Model' },
88
- { iid: 5,
89
- type: '00000023-0000-1000-8000-0026BB765291',
90
- perms: [Array],
91
- format: 'string',
92
- value: 'Basement',
93
- description: 'Name' },
94
- { iid: 6,
95
- type: '00000030-0000-1000-8000-0026BB765291',
96
- perms: [Array],
97
- format: 'string',
98
- value: 'penny-Basement',
99
- description: 'Serial Number' },
100
- { iid: 7,
101
- type: '00000052-0000-1000-8000-0026BB765291',
102
- perms: [Array],
103
- format: 'string',
104
- value: '0.1.21',
105
- description: 'Firmware Revision' } ],
106
- */
107
-
108
- /*
109
- { Identify: undefined,
110
- Manufacturer: 'Default-Manufacturer',
111
- Model: 'Default-Model',
112
- Name: 'FHall',
113
- SerialNumber: 'Default-SerialNumber',
114
- FirmwareRevision: '1.0' }
115
- */
116
-
117
- function information(characteristics) {
118
- var result = {};
119
- characteristics.forEach(function (characteristic) {
120
- if (characteristic.description) {
121
- var key = characteristic.description.replace(/ /g, '').replace(/\./g, '_');
122
- result[key] = characteristic.value;
123
- }
124
- });
125
- return result;
126
- }
@@ -1,30 +0,0 @@
1
- var debug = require('debug')('Characteristic');
2
- // var Service = require('./Service.js').Service;
3
-
4
- module.exports = {
5
- Characteristic: Characteristic
6
- };
7
-
8
- /*
9
- * Homebridges -> Homebridge -> Accessory -> Service -> Characteristic
10
- */
11
-
12
- function Characteristic(devices, context) {
13
- // debug("Characteristic", devices);
14
- this.iid = devices.iid;
15
- this.type = devices.type.substring(0, 8);
16
- this.perms = devices.perms;
17
- this.value = devices.value;
18
- this.description = (devices.description ? devices.description : this.type);
19
- this.characteristic = {};
20
- this.getCharacteristic = context.aid + '.' + this.iid;
21
- this.characteristic[this.getCharacteristic] = {
22
- characteristic: this.description.replace(/ /g, "").replace(/\./g, "_"),
23
- iid: this.iid
24
- };
25
- this.eventRegister = {
26
- aid: context.aid,
27
- iid: this.iid,
28
- "ev": true
29
- };
30
- }