homebridge-yoto 0.0.24 → 0.0.27
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/lib/platform.js +16 -1
- package/lib/playerAccessory.js +1 -0
- package/package.json +1 -1
package/lib/platform.js
CHANGED
|
@@ -353,6 +353,7 @@ export class YotoPlatform {
|
|
|
353
353
|
|
|
354
354
|
// Process each device
|
|
355
355
|
for (const device of devices) {
|
|
356
|
+
this.log.info(LOG_PREFIX.PLATFORM, 'Device from API:', JSON.stringify(device, null, 2))
|
|
356
357
|
await this.registerDevice(device)
|
|
357
358
|
}
|
|
358
359
|
|
|
@@ -385,9 +386,15 @@ export class YotoPlatform {
|
|
|
385
386
|
const displayName = device.description || device.name
|
|
386
387
|
this.log.debug(LOG_PREFIX.PLATFORM, 'Restoring existing accessory:', displayName)
|
|
387
388
|
|
|
388
|
-
// Update display name if it has changed
|
|
389
|
+
// Update display name and AccessoryInformation if it has changed
|
|
389
390
|
if (existingAccessory.displayName !== displayName) {
|
|
390
391
|
existingAccessory.displayName = displayName
|
|
392
|
+
const infoService = existingAccessory.getService(this.api.hap.Service.AccessoryInformation)
|
|
393
|
+
if (infoService) {
|
|
394
|
+
infoService
|
|
395
|
+
.setCharacteristic(this.api.hap.Characteristic.Name, displayName)
|
|
396
|
+
.setCharacteristic(this.api.hap.Characteristic.ConfiguredName, displayName)
|
|
397
|
+
}
|
|
391
398
|
}
|
|
392
399
|
|
|
393
400
|
// Update context with fresh device data
|
|
@@ -418,6 +425,14 @@ export class YotoPlatform {
|
|
|
418
425
|
// eslint-disable-next-line new-cap
|
|
419
426
|
const accessory = new this.api.platformAccessory(displayName, uuid)
|
|
420
427
|
|
|
428
|
+
// Set Name and ConfiguredName on AccessoryInformation service
|
|
429
|
+
const infoService = accessory.getService(this.api.hap.Service.AccessoryInformation)
|
|
430
|
+
if (infoService) {
|
|
431
|
+
infoService
|
|
432
|
+
.setCharacteristic(this.api.hap.Characteristic.Name, displayName)
|
|
433
|
+
.setCharacteristic(this.api.hap.Characteristic.ConfiguredName, displayName)
|
|
434
|
+
}
|
|
435
|
+
|
|
421
436
|
// Create typed accessory with context
|
|
422
437
|
const typedAccessory = /** @type {PlatformAccessory<YotoAccessoryContext>} */ (accessory)
|
|
423
438
|
|
package/lib/playerAccessory.js
CHANGED
|
@@ -173,6 +173,7 @@ export class YotoPlayerAccessory {
|
|
|
173
173
|
.setCharacteristic(this.platform.Characteristic.Model, this.device.deviceType || DEFAULT_MODEL)
|
|
174
174
|
.setCharacteristic(this.platform.Characteristic.SerialNumber, this.device.deviceId)
|
|
175
175
|
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.device.releaseChannel || '1.0.0')
|
|
176
|
+
.setCharacteristic(this.platform.Characteristic.Name, this.accessory.displayName)
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
|
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.
|
|
4
|
+
"version": "0.0.27",
|
|
5
5
|
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/bcomnes/homebridge-yoto/issues"
|