From 5c0cf49020a7332435d9fe765ef9fd71e56fe307 Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Wed, 10 Jan 2024 15:03:05 -0600 Subject: [PATCH] Update meater.ts --- src/device/meater.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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