homebridge-yoto 0.0.26 → 0.0.28

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.
Files changed (2) hide show
  1. package/lib/platform.js +19 -5
  2. package/package.json +1 -1
package/lib/platform.js CHANGED
@@ -381,13 +381,19 @@ export class YotoPlatform {
381
381
 
382
382
  if (existingAccessory) {
383
383
  // Accessory exists - update it
384
- // Use description (player name) for display
385
- const displayName = device.description || device.name
384
+ // Use device name for display
385
+ const displayName = device.name
386
386
  this.log.debug(LOG_PREFIX.PLATFORM, 'Restoring existing accessory:', displayName)
387
387
 
388
- // Update display name if it has changed
388
+ // Update display name and AccessoryInformation if it has changed
389
389
  if (existingAccessory.displayName !== displayName) {
390
390
  existingAccessory.displayName = displayName
391
+ const infoService = existingAccessory.getService(this.api.hap.Service.AccessoryInformation)
392
+ if (infoService) {
393
+ infoService
394
+ .setCharacteristic(this.api.hap.Characteristic.Name, displayName)
395
+ .setCharacteristic(this.api.hap.Characteristic.ConfiguredName, displayName)
396
+ }
391
397
  }
392
398
 
393
399
  // Update context with fresh device data
@@ -410,14 +416,22 @@ export class YotoPlatform {
410
416
  })
411
417
  } else {
412
418
  // Create new accessory
413
- // Use description (player name) for display
414
- const displayName = device.description || device.name
419
+ // Use device name for display
420
+ const displayName = device.name
415
421
  this.log.debug(LOG_PREFIX.PLATFORM, 'Adding new accessory:', displayName)
416
422
 
417
423
  // Create platform accessory
418
424
  // eslint-disable-next-line new-cap
419
425
  const accessory = new this.api.platformAccessory(displayName, uuid)
420
426
 
427
+ // Set Name and ConfiguredName on AccessoryInformation service
428
+ const infoService = accessory.getService(this.api.hap.Service.AccessoryInformation)
429
+ if (infoService) {
430
+ infoService
431
+ .setCharacteristic(this.api.hap.Characteristic.Name, displayName)
432
+ .setCharacteristic(this.api.hap.Characteristic.ConfiguredName, displayName)
433
+ }
434
+
421
435
  // Create typed accessory with context
422
436
  const typedAccessory = /** @type {PlatformAccessory<YotoAccessoryContext>} */ (accessory)
423
437
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-yoto",
3
3
  "description": "Control your Yoto players through Apple HomeKit with real-time MQTT updates",
4
- "version": "0.0.26",
4
+ "version": "0.0.28",
5
5
  "author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/bcomnes/homebridge-yoto/issues"