diff --git a/src/kumo-api.ts b/src/kumo-api.ts index acfe319..60118ef 100644 --- a/src/kumo-api.ts +++ b/src/kumo-api.ts @@ -197,7 +197,8 @@ export class KumoApi { if (existingDeviceIndex !== undefined) { this.log.info('Updated existing device. Serial: %s. Label: %s', device.serial, device.label); - this.devices[existingDeviceIndex] = device; + this.devices[existingDeviceIndex].label = device.label; + this.devices[existingDeviceIndex].zoneTable = device.zoneTable; } else { this.log.info('Found device. Serial: %s. Label: %s', device.serial, device.label); this.devices.push(device); diff --git a/src/platform.ts b/src/platform.ts index 5525a9e..3e24b63 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -185,7 +185,7 @@ export class KumoHomebridgePlatform implements DynamicPlatformPlugin { const overrideAddress = this.optionGetOverrideAddress(device); if (overrideAddress !== null) { this.log.info('Override address found for device - using IP %s instead of %s for direct access', overrideAddress, accessory.context.zoneTable.address); - accessory.context.overrideAddress = overrideAddress; + device.overrideAddress = overrideAddress; } this.log.debug(device.zoneTable); @@ -193,7 +193,7 @@ export class KumoHomebridgePlatform implements DynamicPlatformPlugin { if (this.config.directAccess) { accessory.context.device = await this.kumo.queryDevice_Direct(device.serial); if(accessory.context.device === null) { - this.log.error('Failed to connect to device IP (%s) at %s', device.serial, accessory.context.overrideAddress ?? accessory.context.zoneTable.address); + this.log.error('Failed to connect to device IP (%s) at %s', device.serial, device.overrideAddress ?? accessory.context.zoneTable.address); this.config.directAccess = false; this.log.info('Disabling directAccess to Kumo devices'); accessory.context.device = await this.kumo.queryDevice(device.serial);