@smarterhomeapp/homebridge-vantage 1.0.3 → 1.0.5

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.
@@ -21,6 +21,7 @@ class VantagePlatformAccessory {
21
21
  this.accessory.addService(this.Service.AccessoryInformation);
22
22
  info.setCharacteristic(this.Characteristic.Manufacturer, 'Vantage Controls');
23
23
  info.setCharacteristic(this.Characteristic.Model, device.objectType ?? device.type);
24
+ info.setCharacteristic(this.Characteristic.Name, device.name);
24
25
  info.setCharacteristic(this.Characteristic.SerialNumber, `VID ${device.vid}`);
25
26
  // Build the correct primary service for the type
26
27
  let primary;
@@ -184,6 +185,8 @@ class VantagePlatformAccessory {
184
185
  this.platform.log.warn(`Unsupported device type ${device.type} for ${this.accessory.displayName}`);
185
186
  return;
186
187
  }
188
+ primary.displayName = device.name;
189
+ primary.setCharacteristic(this.Characteristic.Name, device.name);
187
190
  // Mark primary (helps Home app pick the right tile)
188
191
  try {
189
192
  primary.setPrimaryService?.(true);
@@ -295,6 +295,7 @@ class VantageInfusion extends events_1.EventEmitter {
295
295
  const rangeStr = (this.opts.range || '0,999999999').replace(/\s+/g, '');
296
296
  const [minVID, maxVID] = rangeStr.split(',').map((x) => Number.parseInt(x, 10));
297
297
  const blindOpenClose = {};
298
+ const seenNames = new Set();
298
299
  for (const raw of objects) {
299
300
  const key = Object.keys(raw)[0];
300
301
  const it = raw[key];
@@ -311,13 +312,18 @@ class VantageInfusion extends events_1.EventEmitter {
311
312
  if (it.Area && Area[it.Area]?.Name)
312
313
  name = `${Area[it.Area].Name} ${name}`;
313
314
  name = name.replace(/-/g, '') || `VID${vid}`;
315
+ const nameKey = name.toLowerCase();
316
+ if (seenNames.has(nameKey)) {
317
+ name = `${name} VID${vid}`;
318
+ }
319
+ seenNames.add(name.toLowerCase());
314
320
  const pushUnique = (dev) => {
315
321
  if (devices.find((d) => d.vid === vid))
316
322
  return;
317
323
  devices.push(dev);
318
324
  };
319
325
  if (it.DeviceCategory === 'HVAC' || TYPE_THERMO.includes(it.ObjectType)) {
320
- this.opts.log.info(`New HVAC added (VID=${it.VID}, Name=${it.Name})`);
326
+ this.opts.log.info(`New HVAC added (VID=${it.VID}, Name=${name})`);
321
327
  pushUnique({
322
328
  name,
323
329
  address: vid,
@@ -351,7 +357,7 @@ class VantageInfusion extends events_1.EventEmitter {
351
357
  it.LoadType === 'Motor' ||
352
358
  it.LoadType === 'High Voltage Relay';
353
359
  if (isRelay) {
354
- this.opts.log.info(`New relay added (VID=${it.VID}, Name=${it.Name}, RELAY)`);
360
+ this.opts.log.info(`New relay added (VID=${it.VID}, Name=${name}, RELAY)`);
355
361
  pushUnique({
356
362
  name,
357
363
  address: vid,
@@ -364,7 +370,7 @@ class VantageInfusion extends events_1.EventEmitter {
364
370
  });
365
371
  }
366
372
  else if (it.ObjectType === 'Vantage.DDGColorLoad') {
367
- this.opts.log.info(`New load added (VID=${it.VID}, Name=${it.Name}, RGB)`);
373
+ this.opts.log.info(`New load added (VID=${it.VID}, Name=${name}, RGB)`);
368
374
  pushUnique({
369
375
  name,
370
376
  address: vid,
@@ -379,7 +385,7 @@ class VantageInfusion extends events_1.EventEmitter {
379
385
  });
380
386
  }
381
387
  else {
382
- this.opts.log.info(`New load added (VID=${it.VID}, Name=${it.Name}, DIMMER)`);
388
+ this.opts.log.info(`New load added (VID=${it.VID}, Name=${name}, DIMMER)`);
383
389
  pushUnique({
384
390
  name,
385
391
  address: vid,
@@ -398,7 +404,7 @@ class VantageInfusion extends events_1.EventEmitter {
398
404
  blindOpenClose[it.OpenLoad] = it.OpenLoad;
399
405
  blindOpenClose[it.CloseLoad] = it.CloseLoad;
400
406
  }
401
- this.opts.log.info(`New Blind added (VID=${it.VID}, Name=${it.Name}, BLIND)`);
407
+ this.opts.log.info(`New Blind added (VID=${it.VID}, Name=${name}, BLIND)`);
402
408
  pushUnique({ name, address: vid, type: 'blind', vid, objectType: it.ObjectType, pos: 100, posState: 2 });
403
409
  continue;
404
410
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smarterhomeapp/homebridge-vantage",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Homebridge plugin for Vantage InFusion (dynamic platform, HB 1.6+ / 2.0 ready)",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -15,7 +15,7 @@
15
15
  "homepage": "https://github.com/SmarterHomeApp/homebridge-vantage",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "https://github.com/SmarterHomeApp/homebridge-vantage.git"
18
+ "url": "git+https://github.com/SmarterHomeApp/homebridge-vantage.git"
19
19
  },
20
20
  "bugs": {
21
21
  "url": "https://github.com/SmarterHomeApp/homebridge-vantage/issues"
@@ -39,16 +39,16 @@
39
39
  "lint": "eslint 'src/**/*.{ts,tsx}'",
40
40
  "prepublishOnly": "npm run build"
41
41
  },
42
- "dependencies": {
43
- "sprintf-js": "^1.1.3",
44
- "xml2js": "^0.6.2"
45
- },
46
- "devDependencies": {
47
- "@types/xml2js": "^0.4.14",
48
- "homebridge": "^1.11.0",
49
- "typescript": "^5.5.4",
50
- "eslint": "^9.12.0",
51
- "@types/node": "^20.19.11",
52
- "rimraf": "^6.0.1"
53
- }
42
+ "dependencies": {
43
+ "sprintf-js": "^1.1.3",
44
+ "xml2js": "^0.6.2"
45
+ },
46
+ "devDependencies": {
47
+ "@types/xml2js": "^0.4.14",
48
+ "homebridge": "^1.11.0",
49
+ "typescript": "^5.5.4",
50
+ "eslint": "^9.12.0",
51
+ "@types/node": "^20.19.11",
52
+ "rimraf": "^6.0.1"
53
+ }
54
54
  }