diff --git a/homebridge-ui/server.js b/homebridge-ui/server.js index 25cb3dd..b57ad37 100644 --- a/homebridge-ui/server.js +++ b/homebridge-ui/server.js @@ -28,6 +28,7 @@ class UiServer extends HomebridgePluginUiServer { id: device.deviceId, name: device.alias, type: constants.DeviceType[device.deviceType], + serial_number: device.manufacture?.salesModel, }; }), }; diff --git a/src/baseDevice.ts b/src/baseDevice.ts index 5185e88..c38af6a 100644 --- a/src/baseDevice.ts +++ b/src/baseDevice.ts @@ -11,14 +11,14 @@ export class baseDevice extends EventEmitter { ) { super(); - const device = accessory.context.device; + const device: Device = accessory.context.device; const {AccessoryInformation} = this.platform.Service; const serviceAccessoryInformation = accessory.getService(AccessoryInformation) || accessory.addService(AccessoryInformation); // set accessory information serviceAccessoryInformation .setCharacteristic(this.platform.Characteristic.Manufacturer, 'LG') - .setCharacteristic(this.platform.Characteristic.Model, device.model || 'Unknown') + .setCharacteristic(this.platform.Characteristic.Model, device.salesModel || device.model || 'Unknown') .setCharacteristic(this.platform.Characteristic.SerialNumber, this.config.serial_number || device.serialNumber || 'Unknown'); } diff --git a/src/lib/Device.ts b/src/lib/Device.ts index 8ddf7cf..0cb9358 100644 --- a/src/lib/Device.ts +++ b/src/lib/Device.ts @@ -30,6 +30,10 @@ export class Device { return this.data.manufacture?.macAddress; } + public get salesModel(){ + return this.data.manufacture?.salesModel; + } + public get serialNumber() { return this.data.manufacture?.serialNo; }