homebridge-texecom-full 4.2.6-beta.0 → 4.2.6
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/CHANGELOG.md +0 -4
- package/config.schema.json +1 -4
- package/index.js +24 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/config.schema.json
CHANGED
package/index.js
CHANGED
|
@@ -13,6 +13,7 @@ class ResponseEmitter extends EventEmitter { }
|
|
|
13
13
|
const responseEmitter = new ResponseEmitter();
|
|
14
14
|
|
|
15
15
|
const LogUtil = require('./util/logutil');
|
|
16
|
+
const { platform } = require("os");
|
|
16
17
|
|
|
17
18
|
var areas_armed = []; // Creates an empty array, which can later grow dynamically
|
|
18
19
|
|
|
@@ -234,19 +235,35 @@ TexecomPlatform.prototype = {
|
|
|
234
235
|
responseEmitter.emit('data', data);
|
|
235
236
|
processData(data);
|
|
236
237
|
});
|
|
238
|
+
|
|
239
|
+
connection.on('timeout', () => {
|
|
240
|
+
platform.log.error('Connection attempt timed out.');
|
|
241
|
+
connection.destroy(); // prevent crash
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
connection.on('error', (err) => {
|
|
245
|
+
platform.log.error(`Socket error: ${err.message}`);
|
|
246
|
+
});
|
|
247
|
+
|
|
237
248
|
connection.on('end', function () {
|
|
238
249
|
platform.log.log('IP connection ended');
|
|
239
250
|
});
|
|
240
251
|
|
|
241
252
|
connection.on('close', function () {
|
|
242
253
|
platform.log.log('IP connection closed');
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
254
|
+
|
|
255
|
+
setTimeout(() => {
|
|
256
|
+
platform.log.log('Attempting reconnect...');
|
|
257
|
+
|
|
258
|
+
try {
|
|
259
|
+
connection = net.createConnection(platform.ip_port, platform.ip_address, function () {
|
|
260
|
+
platform.log.log('Re-connected after loss of connection');
|
|
261
|
+
});
|
|
262
|
+
} catch (err) {
|
|
263
|
+
platform.log.error(err);
|
|
264
|
+
}
|
|
265
|
+
}, 10000);
|
|
266
|
+
|
|
250
267
|
});
|
|
251
268
|
this.texecomConnection = connection;
|
|
252
269
|
} else {
|
|
@@ -335,13 +352,6 @@ TexecomAccessory.prototype = {
|
|
|
335
352
|
.setValue(newState ? Characteristic.CarbonMonoxideDetected.CO_LEVELS_ABNORMAL : Characteristic.CarbonMonoxideDetected.CO_LEVELS_NORMAL);
|
|
336
353
|
};
|
|
337
354
|
break;
|
|
338
|
-
case "carbondioxide":
|
|
339
|
-
service = new Service.CarbonDioxideSensor();
|
|
340
|
-
changeAction = function (newState) {
|
|
341
|
-
service.getCharacteristic(Characteristic.CarbonDioxideDetected)
|
|
342
|
-
.setValue(newState ? Characteristic.CarbonDioxideDetected.CO_LEVELS_ABNORMAL : Characteristic.CarbonDioxideDetected.CO_LEVELS_NORMAL);
|
|
343
|
-
};
|
|
344
|
-
break;
|
|
345
355
|
|
|
346
356
|
case "securitysystem":
|
|
347
357
|
service = new Service.SecuritySystem();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"displayName": "Homebridge Texecom",
|
|
3
3
|
"name": "homebridge-texecom-full",
|
|
4
4
|
"description": "A plugin for homebridge to integrate Texecom Premier Elite alarm systems into HomeKit",
|
|
5
|
-
"version": "4.2.6
|
|
5
|
+
"version": "4.2.6",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Chris Posthumus",
|
|
8
8
|
"email": "chris.posthumus@gmail.com"
|