Skip to content

Commit

Permalink
Merge pull request #7 from devenbj/Model-SN-Characteristics
Browse files Browse the repository at this point in the history
Add Model and SerialNumber characteristic support
  • Loading branch information
kovapatrik authored Jul 10, 2024
2 parents a81f8ac + 24bbbef commit eafa7e6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
12 changes: 11 additions & 1 deletion config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
"type": "string",
"required": true
},
"model": {
"title": "Model",
"type": "string"
},
"serialNumber": {
"title": "Serial Number",
"type": "string"
},
"filterChangeLevel": {
"title": "Filter Change Level",
"description": "Percentage of filter life remaining to trigger a filter change alert.",
Expand Down Expand Up @@ -127,6 +135,8 @@
"items": [
"devices[].id",
"devices[].name",
"devices[].model",
"devices[].serialNumber",
"devices[].filterChangeLevel",
"devices[].led",
"devices[].airQualitySensor",
Expand All @@ -138,4 +148,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Homebridge BlueAir Platform",
"name": "homebridge-blueair-purifier",
"version": "1.0.9",
"version": "1.0.10",
"description": "Homebridge plugin for BlueAir purifiers",
"license": "Apache-2.0",
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion src/accessory/AirPurifierAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export class AirPurifierAccessory {
) {
this.accessory
.getService(this.platform.Service.AccessoryInformation)!
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'BlueAir');
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'BlueAir')
.setCharacteristic(this.platform.Characteristic.Model, this.configDev.model || 'BlueAir Purifier')
.setCharacteristic(this.platform.Characteristic.SerialNumber, this.configDev.serialNumber || 'BlueAir Device');

this.service =
this.accessory.getService(this.platform.Service.AirPurifier) || this.accessory.addService(this.platform.Service.AirPurifier);
Expand Down
4 changes: 4 additions & 0 deletions src/platformUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export type Config = {
export type DeviceConfig = {
id: string;
name: string;
model: string;
serialNumber: string;
filterChangeLevel: number;
led: boolean;
airQualitySensor: boolean;
Expand Down Expand Up @@ -54,6 +56,8 @@ export const defaultConfig: Config = {
export const defaultDeviceConfig: DeviceConfig = {
id: '',
name: '',
model: '',
serialNumber: '',
filterChangeLevel: 90,
led: false,
airQualitySensor: false,
Expand Down

0 comments on commit eafa7e6

Please sign in to comment.