homebridge-winix-purifiers 2.2.2 → 2.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.
Files changed (2) hide show
  1. package/dist/platform.js +7 -1
  2. package/package.json +3 -1
package/dist/platform.js CHANGED
@@ -81,7 +81,13 @@ class WinixPurifierPlatform {
81
81
  const uuid = this.api.hap.uuid.generate(device.deviceId);
82
82
  let accessory = this.accessories.get(uuid);
83
83
  this.log.debug('Found', accessory ? 'existing' : 'new', 'accessory:', this.logName(device));
84
- if (accessory) {
84
+ if (accessory && this.handlers.has(uuid)) {
85
+ // Existing device on refresh: update metadata only, keep handler + polling loop
86
+ accessory.context.device = device;
87
+ this.api.updatePlatformAccessories([accessory]);
88
+ }
89
+ else if (accessory) {
90
+ // First boot with cached accessory: create handler
85
91
  accessory.context.device = device;
86
92
  const handler = await this.createNewAccessoryHandler(accessory, devices.length);
87
93
  this.handlers.set(uuid, handler);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Winix Air Purifiers",
3
3
  "name": "homebridge-winix-purifiers",
4
- "version": "2.2.2",
4
+ "version": "2.2.3",
5
5
  "description": "Homebridge plugin for Winix air purifiers",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -44,6 +44,8 @@
44
44
  "postversion": "git push && git push --tags && yarn clean",
45
45
  "prepublishOnly": "yarn validate",
46
46
  "test": "vitest run",
47
+ "test:integration": "vitest run --config vitest.integration.config.ts tests/integration/integration.test.ts --reporter=verbose",
48
+ "test:integration:rate-limit": "vitest run --config vitest.integration.config.ts tests/integration/integration-rate-limit.test.ts --reporter=verbose",
47
49
  "test:watch": "vitest",
48
50
  "test:coverage": "vitest run --coverage",
49
51
  "validate": "yarn lint && yarn build && yarn test",