homebridge-texecom-full 4.2.7-beta.1 → 4.2.8

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 CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  This change log documents all release versions of homebridge-texecom
4
4
 
5
+ ### 4.2.8 (2025-7-28)
6
+
7
+ - **TWEAK** - Data conversion issue (Typo)
8
+ - **NEWS** - We are verified!!
9
+
10
+ ### 4.2.7 (2025-7-28)
11
+
12
+ - **FIX** - Connection issue
13
+ - **NEWS** - We are verified!!
14
+
5
15
  ### 4.2.6 (2025-07-25)
6
16
 
7
17
  - **FIX** - Fixed issues for Verification.
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  [![npm beta version](https://badgen.net/npm/v/homebridge-texecom-full/beta)](https://www.npmjs.com/package/homebridge-texecom-full)
3
3
  [![npm downloads](https://badgen.net/npm/dt/homebridge-texecom-full)](https://www.npmjs.com/package/homebridge-texecom-full)
4
4
  [![GitHub last commit](https://badgen.net/github/last-commit/K1LL3R234/homebridge-texecom)](https://github.com/K1LL3R234/homebridge-texecom)
5
+ [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
5
6
  # homebridge-texecom-full
6
7
 
7
8
  A plugin for [Homebridge](https://github.com/nfarina/homebridge) that creates HomeKit motion, contact, smoke, or carbon monoxide sensors for alarm zones from a Texecom Premier intruder alarm via a serial connection or COM-IP module.
package/index.js CHANGED
@@ -13,7 +13,6 @@ class ResponseEmitter extends EventEmitter { }
13
13
  const responseEmitter = new ResponseEmitter();
14
14
 
15
15
  const LogUtil = require('./util/logutil');
16
- const { platform } = require("os");
17
16
 
18
17
  var areas_armed = []; // Creates an empty array, which can later grow dynamically
19
18
 
@@ -203,6 +202,42 @@ TexecomPlatform.prototype = {
203
202
  }
204
203
  }
205
204
 
205
+ function setupConnection() {
206
+ platform.log.log('Attempting connection to Texecom...');
207
+
208
+ connection = net.createConnection(platform.ip_port, platform.ip_address);
209
+
210
+ connection.setNoDelay(true);
211
+
212
+ connection.on('connect', () => {
213
+ platform.log.log('Connected via IP');
214
+ });
215
+
216
+ connection.on('data', function (data) {
217
+ platform.log.debug(`IP data received: ${data}`);
218
+ responseEmitter.emit('data', data);
219
+ processData(data);
220
+ });
221
+
222
+ connection.on('error', (err) => {
223
+ platform.log.error('IP connection error:', err.message);
224
+ // We'll reconnect on 'close'
225
+ });
226
+
227
+ connection.on('close', () => {
228
+ platform.log.error('IP connection closed. Will attempt to reconnect in 10s.');
229
+ setTimeout(() => {
230
+ setupConnection(); // try again
231
+ }, 10000);
232
+ });
233
+
234
+ connection.on('end', () => {
235
+ platform.log.log('IP connection ended');
236
+ });
237
+
238
+ platform.texecomConnection = connection;
239
+ }
240
+
206
241
  if (this.serial_device) {
207
242
  var SerialPort = serialport.SerialPort;
208
243
 
@@ -221,7 +256,11 @@ TexecomPlatform.prototype = {
221
256
  });
222
257
  this.texecomConnection = serialPort;
223
258
  } else if (this.ip_address) {
224
- try {
259
+
260
+ setupConnection();
261
+
262
+
263
+ /*try {
225
264
  connection = net.createConnection(platform.ip_port, platform.ip_address, function () {
226
265
  platform.log.log('Connected via IP');
227
266
  });
@@ -236,13 +275,10 @@ TexecomPlatform.prototype = {
236
275
  processData(data);
237
276
  });
238
277
 
239
- connection.on('timeout', () => {
240
- platform.log.error('Connection attempt timed out.');
241
- connection.destroy(); // prevent crash
242
- });
243
278
 
244
- connection.on('error', (err) => {
245
- platform.log.error(`Socket error: ${err.message}`);
279
+ connection.on('error', function (err) {
280
+ platform.log.error(`IP connection error: ${err}`);
281
+
246
282
  });
247
283
 
248
284
  connection.on('end', function () {
@@ -251,27 +287,22 @@ TexecomPlatform.prototype = {
251
287
 
252
288
  connection.on('close', function () {
253
289
  platform.log.log('IP connection closed');
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
-
290
+ try {
291
+ connection = net.createConnection(platform.ip_port, platform.ip_address, function () {
292
+ platform.log.log('Re-connected after loss of connection');
293
+ });
294
+ } catch (err) {
295
+ platform.log.error(err);
296
+ }
267
297
  });
268
- this.texecomConnection = connection;
298
+ this.texecomConnection = connection;*/
269
299
  } else {
270
300
  this.log.log("Must set either serial_device or ip_address in configuration.");
271
301
  }
272
302
  }
273
303
  }
274
304
 
305
+
275
306
  function TexecomAccessory(log, config) {
276
307
  this.log = log;
277
308
 
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.7-beta.1",
5
+ "version": "4.2.8",
6
6
  "author": {
7
7
  "name": "Chris Posthumus",
8
8
  "email": "chris.posthumus@gmail.com"