homebridge-yoto 0.0.21 → 0.0.22

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 +12 -3
  2. package/package.json +1 -1
package/lib/platform.js CHANGED
@@ -381,7 +381,14 @@ export class YotoPlatform {
381
381
 
382
382
  if (existingAccessory) {
383
383
  // Accessory exists - update it
384
- this.log.debug(LOG_PREFIX.PLATFORM, 'Restoring existing accessory:', device.name)
384
+ // Use description (player name) for display
385
+ const displayName = device.description || device.name
386
+ this.log.debug(LOG_PREFIX.PLATFORM, 'Restoring existing accessory:', displayName)
387
+
388
+ // Update display name if it has changed
389
+ if (existingAccessory.displayName !== displayName) {
390
+ existingAccessory.displayName = displayName
391
+ }
385
392
 
386
393
  // Update context with fresh device data
387
394
  const typedAccessory = /** @type {PlatformAccessory<YotoAccessoryContext>} */ (existingAccessory)
@@ -403,11 +410,13 @@ export class YotoPlatform {
403
410
  })
404
411
  } else {
405
412
  // Create new accessory
406
- this.log.debug(LOG_PREFIX.PLATFORM, 'Adding new accessory:', device.name)
413
+ // Use description (player name) for display
414
+ const displayName = device.description || device.name
415
+ this.log.debug(LOG_PREFIX.PLATFORM, 'Adding new accessory:', displayName)
407
416
 
408
417
  // Create platform accessory
409
418
  // eslint-disable-next-line new-cap
410
- const accessory = new this.api.platformAccessory(device.name, uuid)
419
+ const accessory = new this.api.platformAccessory(displayName, uuid)
411
420
 
412
421
  // Create typed accessory with context
413
422
  const typedAccessory = /** @type {PlatformAccessory<YotoAccessoryContext>} */ (accessory)
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.21",
4
+ "version": "0.0.22",
5
5
  "author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/bcomnes/homebridge-yoto/issues"