homebridge-philips-air-purifier-complete 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,29 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
6
6
 
7
7
  ---
8
8
 
9
+ ## [3.2.3] — 15/06/2026
10
+
11
+ ### Changed
12
+
13
+ - Legacy top-level `accessories[]` entries are no longer served by default. The compatibility shim
14
+ now logs a migration error and returns no HomeKit services, which stops old accessory config from
15
+ keeping duplicate or orphaned purifiers alive after migrating to the v3 platform.
16
+ - Added `PHILIPS_AIR_ALLOW_LEGACY_ACCESSORY=1` as a temporary rollback switch for users who need
17
+ one more start on the old accessory path while moving config into `platforms[].devices[]`.
18
+
19
+ ---
20
+
21
+ ## [3.2.2] — 15/06/2026
22
+
23
+ ### Fixed
24
+
25
+ - Fixed a Homebridge crash loop when restoring cached purifier accessories after the first
26
+ successful v3 platform startup. Optional HomeKit characteristics are now reused instead of
27
+ added again on restored services.
28
+ - Corrected package lockfile version metadata after the v3.2.1 release.
29
+
30
+ ---
31
+
9
32
  ## [3.2.1] — 15/06/2026
10
33
 
11
34
  ### Fixed
package/README.md CHANGED
@@ -149,6 +149,14 @@ v3.0.0 changes the plugin type from `accessory` to `platform`. Update your Homeb
149
149
 
150
150
  3. Restart Homebridge.
151
151
 
152
+ From v3.2.3, old top-level `"accessory": "PhilipsAirPurifier"` entries are not loaded by
153
+ default. If Homebridge logs `Loading 1 accessories...` followed by
154
+ `Legacy accessories[] config detected`, the old entry is still present in the full Homebridge
155
+ `config.json` even if this plugin's platform settings modal only shows `{ "platform":
156
+ "PhilipsAirPurifier" }`. Remove the old object from the top-level `"accessories"` array and keep
157
+ the device under `"platforms"[]."devices"` instead. For temporary rollback only, set
158
+ `PHILIPS_AIR_ALLOW_LEGACY_ACCESSORY=1` before starting Homebridge.
159
+
152
160
  ### Migration examples
153
161
 
154
162
  #### CoAP device
package/index.js CHANGED
@@ -649,7 +649,7 @@ class PhilipsAirPurifierAccessory {
649
649
  this.updatePurifierCharacteristics();
650
650
  });
651
651
 
652
- this.purifierService.addCharacteristic(Characteristic.RotationSpeed)
652
+ this.purifierService.getCharacteristic(Characteristic.RotationSpeed)
653
653
  .onGet(() => MODE_TO_SPEED[this.state.mode] ?? 100)
654
654
  .onSet(async (value) => {
655
655
  this.log.info(`[SET] RotationSpeed: ${value}%`);
@@ -665,7 +665,7 @@ class PhilipsAirPurifierAccessory {
665
665
  });
666
666
 
667
667
  // Child Lock (LockPhysicalControls)
668
- this.purifierService.addCharacteristic(Characteristic.LockPhysicalControls)
668
+ this.purifierService.getCharacteristic(Characteristic.LockPhysicalControls)
669
669
  .onGet(() => this.state.childLock
670
670
  ? Characteristic.LockPhysicalControls.CONTROL_LOCK_ENABLED
671
671
  : Characteristic.LockPhysicalControls.CONTROL_LOCK_DISABLED)
@@ -681,7 +681,7 @@ class PhilipsAirPurifierAccessory {
681
681
  this.platformAcc.addService(Service.AirQualitySensor, 'Air Quality');
682
682
  this.airQualitySensor.getCharacteristic(Characteristic.AirQuality)
683
683
  .onGet(() => this.pm25ToAirQuality(this.state.pm25));
684
- this.airQualitySensor.addCharacteristic(Characteristic.PM2_5Density)
684
+ this.airQualitySensor.getCharacteristic(Characteristic.PM2_5Density)
685
685
  .onGet(() => this.state.pm25 || 0);
686
686
 
687
687
  // HEPA Filter Maintenance
@@ -724,7 +724,7 @@ class PhilipsAirPurifierAccessory {
724
724
  await this.executeCommand('light', [level.toString()], { lightLevel: level });
725
725
  this.updateLightCharacteristics();
726
726
  });
727
- this.lightService.addCharacteristic(Characteristic.Brightness)
727
+ this.lightService.getCharacteristic(Characteristic.Brightness)
728
728
  .onGet(() => {
729
729
  if (this.state.lightLevel === LIGHT.DIM) return 50;
730
730
  if (this.state.lightLevel === LIGHT.OFF) return 0;
@@ -875,14 +875,27 @@ class PhilipsAirPurifierAccessory {
875
875
  }
876
876
  }
877
877
 
878
- class PhilipsAirPurifierLegacyAccessory extends PhilipsAirPurifierAccessory {
878
+ class PhilipsAirPurifierLegacyAccessory {
879
879
  constructor(log, config, api) {
880
- log.warn('[PhilipsAir] Legacy accessory config detected. v3 uses a platform config under platforms[].devices[]. See the README migration guide.');
881
- super(log, config, api, new LegacyPlatformAccessory(api));
880
+ this.accessory = null;
881
+
882
+ if (process.env.PHILIPS_AIR_ALLOW_LEGACY_ACCESSORY !== '1') {
883
+ log.error('[PhilipsAir] Legacy accessories[] config detected and will not be loaded. Move this entry into platforms[].devices[] and remove the top-level accessories[] entry. Set PHILIPS_AIR_ALLOW_LEGACY_ACCESSORY=1 only as a temporary rollback.');
884
+ return;
885
+ }
886
+
887
+ log.warn('[PhilipsAir] Legacy accessories[] config enabled by PHILIPS_AIR_ALLOW_LEGACY_ACCESSORY=1. This compatibility path is deprecated; migrate to platforms[].devices[].');
888
+ this.accessory = new PhilipsAirPurifierAccessory(log, config, api, new LegacyPlatformAccessory(api));
882
889
  }
883
890
 
884
891
  getServices() {
885
- return this.platformAcc.getServices();
892
+ return this.accessory ? this.accessory.platformAcc.getServices() : [];
893
+ }
894
+
895
+ identify() {
896
+ if (this.accessory) {
897
+ this.accessory.identify();
898
+ }
886
899
  }
887
900
  }
888
901
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-philips-air-purifier-complete",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "customUi": true,
5
5
  "description": "Homebridge plugin for Philips Air Purifier with bundled CoAP control library and Python 3.12+/Node.js 24 support",
6
6
  "main": "index.js",