diff --git a/src/device/meater.ts b/src/device/meater.ts index ea2de5d..754aa21 100644 --- a/src/device/meater.ts +++ b/src/device/meater.ts @@ -52,23 +52,28 @@ export class Meater { // Temperature Sensor Services (this.internalTemperatureService = - this.accessory.getService(this.hap.Service.TemperatureSensor) || this.accessory.addService(this.hap.Service.TemperatureSensor)), device.id; - this.internalTemperatureService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Internal Temperature`); + this.accessory.getService(this.hap.Service.TemperatureSensor) || + this.accessory.addService(this.hap.Service.TemperatureSensor), `${device.id} Internal`), `${device.id} Internal`; + this.internalTemperatureService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName.slice(0, 5)} Internal Temperature`); if ( !this.internalTemperatureService.testCharacteristic(this.hap.Characteristic.ConfiguredName) && !this.internalTemperatureService.testCharacteristic(this.hap.Characteristic.Name) ) { - this.internalTemperatureService.addCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Internal Temperature`); + this.internalTemperatureService.addCharacteristic( + this.hap.Characteristic.ConfiguredName, `${accessory.displayName.slice(0, 5)} Internal Temperature`, + ); } (this.ambientTemperatureService = - this.accessory.getService(this.hap.Service.TemperatureSensor) || this.accessory.addService(this.hap.Service.TemperatureSensor)), device.id; - this.ambientTemperatureService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Ambient Temperature`); + this.accessory.getService(this.hap.Service.TemperatureSensor) || + this.accessory.addService(this.hap.Service.TemperatureSensor), `${device.id} Ambient`), `${device.id} Ambient`; + this.ambientTemperatureService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName.slice(0, 5)} Ambient Temperature`); if ( !this.ambientTemperatureService.testCharacteristic(this.hap.Characteristic.ConfiguredName) && !this.ambientTemperatureService.testCharacteristic(this.hap.Characteristic.Name) ) { - this.ambientTemperatureService.addCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Ambient Temperature`); + this.ambientTemperatureService.addCharacteristic( + this.hap.Characteristic.ConfiguredName, `${accessory.displayName.slice(0, 5)} Ambient Temperature`); } // Retrieve initial values and update Homekit