@homebridge-plugins/homebridge-august 3.2.2 → 3.3.0-beta.0
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/.github/copilot-instructions.md +200 -0
- package/.github/npm-version-script-esm.js +97 -0
- package/CHANGELOG.md +44 -9
- package/dist/Platform.Base.d.ts +288 -0
- package/dist/Platform.Base.d.ts.map +1 -0
- package/dist/Platform.Base.js +797 -0
- package/dist/Platform.Base.js.map +1 -0
- package/dist/Platform.HAP.d.ts +27 -0
- package/dist/Platform.HAP.d.ts.map +1 -0
- package/dist/Platform.HAP.js +68 -0
- package/dist/Platform.HAP.js.map +1 -0
- package/dist/connectivity-manager.d.ts +3 -3
- package/dist/connectivity-manager.d.ts.map +1 -1
- package/dist/connectivity-manager.js +57 -14
- package/dist/connectivity-manager.js.map +1 -1
- package/dist/devices/device.d.ts +5 -16
- package/dist/devices/device.d.ts.map +1 -1
- package/dist/devices/device.js +18 -75
- package/dist/devices/device.js.map +1 -1
- package/dist/devices/lock.d.ts +3 -3
- package/dist/devices/lock.d.ts.map +1 -1
- package/dist/devices/lock.js +41 -41
- package/dist/devices/lock.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/package.json +10 -8
- package/dist/platform.matter.d.ts +18 -20
- package/dist/platform.matter.d.ts.map +1 -1
- package/dist/platform.matter.js +74 -80
- package/dist/platform.matter.js.map +1 -1
- package/docs/variables/default.html +1 -1
- package/package.json +10 -8
- package/test/device.test.ts +384 -0
- package/test/{platform.test.ts → platform.hap.test.ts} +23 -23
- package/test/platform.polling.test.ts +5 -5
- package/.copilot/instructions.md +0 -261
- package/.github/scripts/compute-version-override.cjs +0 -51
- package/.github/scripts/normalize-changelog-header.cjs +0 -86
- package/.github/scripts/npm-version-script-esm-auto.js +0 -201
- package/.github/scripts/resolve-version-bump-esm.js +0 -118
- package/dist/platform.d.ts +0 -146
- package/dist/platform.d.ts.map +0 -1
- package/dist/platform.js +0 -755
- package/dist/platform.js.map +0 -1
- package/test/connectivity-manager.test.ts +0 -590
- package/test/platform.matter.test.ts +0 -660
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AugustPlatformHAP } from './Platform.HAP.js';
|
|
2
|
+
import { AugustPlatformMatter } from './Platform.Matter.js';
|
|
3
3
|
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js';
|
|
4
4
|
// Register our platform with homebridge.
|
|
5
5
|
// Create a proxy constructor that selects the appropriate platform implementation
|
|
@@ -7,9 +7,9 @@ function createAugustPlatformProxy(api) {
|
|
|
7
7
|
return function AugustPlatformProxy(log, config, apiInner) {
|
|
8
8
|
const disableMatter = config?.options?.disableMatter;
|
|
9
9
|
if (api.isMatterAvailable?.() && api.isMatterEnabled?.() && !disableMatter) {
|
|
10
|
-
return new
|
|
10
|
+
return new AugustPlatformMatter(log, config, apiInner);
|
|
11
11
|
}
|
|
12
|
-
return new
|
|
12
|
+
return new AugustPlatformHAP(log, config, apiInner);
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
// Register our platform proxy with homebridge.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE1D,yCAAyC;AACzC,kFAAkF;AAClF,SAAS,yBAAyB,CAAC,GAAQ;IACzC,OAAO,SAAS,mBAAmB,CAAC,GAAY,EAAE,MAAsB,EAAE,QAAa;QACrF,MAAM,aAAa,GAAG,MAAM,EAAE,OAAO,EAAE,aAAa,CAAA;QAEpD,IAAI,GAAG,CAAC,iBAAiB,EAAE,EAAE,IAAI,GAAG,CAAC,eAAe,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3E,OAAO,IAAI,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;QACxD,CAAC;QAED,OAAO,IAAI,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IACrD,CAAC,CAAA;AACH,CAAC;AAED,+CAA+C;AAC/C,eAAe,CAAC,GAAQ,EAAQ,EAAE;IAChC,0EAA0E;IAC1E,mEAAmE;IACnE,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,aAAa,EAAE,yBAAyB,CAAC,GAAG,CAAmB,CAAC,CAAA;AACpG,CAAC,CAAA"}
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@homebridge-plugins/homebridge-august",
|
|
3
3
|
"displayName": "August",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.3.0-beta.0",
|
|
6
6
|
"description": "The August plugin allows you to access your August & Yale device(s) from HomeKit.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "donavanbecker",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
],
|
|
39
39
|
"main": "dist/index.js",
|
|
40
40
|
"engines": {
|
|
41
|
-
"homebridge": "^
|
|
41
|
+
"homebridge": "^2.0.1",
|
|
42
42
|
"node": "^22 || ^24"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"check": "npm install && npm outdated",
|
|
46
|
-
"lint": "eslint src --no-warn-ignored",
|
|
47
|
-
"lint:fix": "eslint src --fix --no-warn-ignored",
|
|
46
|
+
"lint": "eslint 'src/**/*.ts' --no-warn-ignored",
|
|
47
|
+
"lint:fix": "eslint 'src/**/*.ts' --fix --no-warn-ignored",
|
|
48
48
|
"watch": "npm run build && npm run plugin-ui && npm link && nodemon",
|
|
49
49
|
"plugin-ui": "rsync ./src/homebridge-ui/public/index.html ./dist/homebridge-ui/public/",
|
|
50
50
|
"build": "npm run clean && tsc && npm run plugin-ui && cp package.json dist/package.json || true",
|
|
@@ -61,23 +61,25 @@
|
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
+
"@homebridge/plugin-logger": "^1.0.0",
|
|
64
65
|
"@homebridge/plugin-ui-utils": "^2.2.3",
|
|
65
66
|
"august-yale": "^1.2.2",
|
|
66
67
|
"rxjs": "^7.8.2"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@antfu/eslint-config": "^8.2.0",
|
|
70
|
-
"@types/node": "^25.6.
|
|
71
|
+
"@types/node": "^25.6.2",
|
|
71
72
|
"@vitest/coverage-v8": "^4.1.5",
|
|
72
73
|
"eslint": "^10.3.0",
|
|
73
74
|
"eslint-plugin-format": "^2.0.1",
|
|
74
|
-
"eslint-plugin-
|
|
75
|
+
"eslint-plugin-html": "^8.1.4",
|
|
76
|
+
"eslint-plugin-perfectionist": "^5.8.0",
|
|
75
77
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
76
|
-
"homebridge": "^2.0.
|
|
78
|
+
"homebridge": "^2.0.1",
|
|
77
79
|
"nodemon": "^3.1.14",
|
|
78
80
|
"shx": "^0.4.0",
|
|
79
81
|
"typedoc": "^0.28.19",
|
|
80
82
|
"typescript": "^6.0.3",
|
|
81
83
|
"vitest": "^4.1.5"
|
|
82
84
|
}
|
|
83
|
-
}
|
|
85
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { MatterAccessory, MatterAPI, PlatformAccessory } from 'homebridge';
|
|
2
|
+
import type { Subscription } from 'rxjs';
|
|
2
3
|
import type { device, devicesConfig } from './settings.js';
|
|
3
|
-
import {
|
|
4
|
+
import { AugustPlatformBase } from './Platform.Base.js';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Extends
|
|
6
|
+
* AugustPlatformMatter
|
|
7
|
+
* Extends AugustPlatformBase to register August locks as Matter DoorLock accessories
|
|
7
8
|
* instead of HAP accessories. Used when Homebridge Matter support is available,
|
|
8
9
|
* enabled, and not disabled by the `disableMatter` config option.
|
|
9
10
|
*/
|
|
10
|
-
export declare class
|
|
11
|
+
export declare class AugustPlatformMatter extends AugustPlatformBase {
|
|
11
12
|
readonly matterAccessories: Map<string, MatterAccessory>;
|
|
12
13
|
private readonly pendingHapCleanup;
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
readonly matterPubNubUnsubscribes: Map<string, () => void>;
|
|
15
|
+
readonly matterPollingSubscriptions: Map<string, Subscription>;
|
|
15
16
|
/**
|
|
16
17
|
* Called when homebridge restores cached HAP accessories from disk at startup.
|
|
17
18
|
* HAP accessories are staged here and removed only after Matter registration
|
|
@@ -43,15 +44,12 @@ export declare class AugustMatterPlatform extends AugustPlatform {
|
|
|
43
44
|
private sweepUnhandledHapAccessories;
|
|
44
45
|
/**
|
|
45
46
|
* Register an August lock as a Matter DoorLock accessory.
|
|
47
|
+
*
|
|
48
|
+
* Stores a lock mechanism in the base class lockMechanisms map for unified teardown (PubNub and polling).
|
|
49
|
+
* The lock mechanism must implement tearDownPubNubSubscription for proper cleanup.
|
|
46
50
|
* Overrides the HAP-based Lock() method from AugustPlatform.
|
|
47
51
|
*/
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Subscribe to August real-time lock events and update the Matter DoorLock state.
|
|
51
|
-
* Captures the unsubscribe function returned by August.subscribe() to allow proper
|
|
52
|
-
* cleanup on lock removal (equivalent of the fix in lock.ts / PR #206 for HAP).
|
|
53
|
-
*/
|
|
54
|
-
private subscribeAugustMatter;
|
|
52
|
+
Lock(device: device & devicesConfig): Promise<void>;
|
|
55
53
|
/**
|
|
56
54
|
* Map an August lock state (from details() or a PubNub event) to a Matter
|
|
57
55
|
* DoorLock.LockState enum value.
|
|
@@ -76,17 +74,17 @@ export declare class AugustMatterPlatform extends AugustPlatform {
|
|
|
76
74
|
* DoorLock state. Uses `timer(0, ...)` for an immediate first fetch (accurate initial state)
|
|
77
75
|
* and `exhaustMap` to prevent overlapping concurrent requests.
|
|
78
76
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* the timer keeps firing forever even after the accessory is gone.
|
|
77
|
+
* Returns the polling subscription so it can be disposed by the lock mechanism's teardown method.
|
|
78
|
+
*
|
|
79
|
+
* @returns {Subscription | undefined} The polling subscription, or undefined if polling is disabled.
|
|
83
80
|
*/
|
|
84
81
|
private startMatterStatusPolling;
|
|
85
82
|
/**
|
|
86
83
|
* Release all resources associated with a given Matter lock UUID:
|
|
87
|
-
* the registered Matter accessory
|
|
88
|
-
*
|
|
89
|
-
*
|
|
84
|
+
* the registered Matter accessory and the lock mechanism (PubNub/polling teardown).
|
|
85
|
+
*
|
|
86
|
+
* Finds the lock mechanism by UUID, calls its tearDownPubNubSubscription (for PubNub and polling),
|
|
87
|
+
* and removes it from the lockMechanisms map. Also unregisters the Matter accessory.
|
|
90
88
|
*/
|
|
91
89
|
private tearDownMatterLock;
|
|
92
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.matter.d.ts","sourceRoot":"","sources":["../src/platform.matter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"platform.matter.d.ts","sourceRoot":"","sources":["../src/platform.matter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAK1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAGvD;;;;;GAKG;AAEH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAE1D,SAAgB,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAY;IAI3E,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA4C;IAG9E,SAAgB,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAY;IAK7E,SAAgB,0BAA0B,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAY;IAEjF;;;;;OAKG;IACY,kBAAkB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9E;;;OAGG;IACH,wBAAwB,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI;IAK1D;;;;;;;;;;;;;;OAcG;IACY,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;YAKjC,4BAA4B;IAY1C;;;;;;OAMG;IACmB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAwJzE;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAapB;;;;;;;;OAQG;IACG,6BAA6B,CACjC,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,IAAI,CAAC;IAuBhB;;;;;;;;OAQG;IACH,OAAO,CAAC,wBAAwB;IAwBhC;;;;;;OAMG;YACW,kBAAkB;CAgCjC"}
|
package/dist/platform.matter.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import August from 'august-yale';
|
|
2
1
|
import { timer } from 'rxjs';
|
|
3
2
|
import { exhaustMap } from 'rxjs/operators';
|
|
4
|
-
import {
|
|
3
|
+
import { AugustPlatformBase } from './Platform.Base.js';
|
|
5
4
|
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js';
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
* Extends
|
|
6
|
+
* AugustPlatformMatter
|
|
7
|
+
* Extends AugustPlatformBase to register August locks as Matter DoorLock accessories
|
|
9
8
|
* instead of HAP accessories. Used when Homebridge Matter support is available,
|
|
10
9
|
* enabled, and not disabled by the `disableMatter` config option.
|
|
11
10
|
*/
|
|
12
|
-
export class
|
|
11
|
+
export class AugustPlatformMatter extends AugustPlatformBase {
|
|
13
12
|
// Track restored Matter cached accessories
|
|
14
13
|
matterAccessories = new Map();
|
|
15
14
|
// HAP accessories staged for removal after Matter registration succeeds.
|
|
16
15
|
// Deferred to avoid leaving users with zero accessories if Matter init fails.
|
|
17
16
|
pendingHapCleanup = new Map();
|
|
18
|
-
// PubNub unsubscribe functions keyed by accessory UUID
|
|
19
|
-
// Must be captured from August.subscribe() and called on lock removal to
|
|
20
|
-
// prevent accumulating orphaned PubNub instances (equivalent of the fix in
|
|
21
|
-
// lock.ts / PR #206 for the HAP path).
|
|
17
|
+
// PubNub unsubscribe functions keyed by accessory UUID (for test compatibility)
|
|
22
18
|
matterPubNubUnsubscribes = new Map();
|
|
23
19
|
// RxJS polling subscriptions keyed by accessory UUID. Must be tracked so
|
|
24
20
|
// they can be unsubscribed when a lock is removed or re-registered, otherwise
|
|
@@ -74,12 +70,15 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
74
70
|
}
|
|
75
71
|
/**
|
|
76
72
|
* Register an August lock as a Matter DoorLock accessory.
|
|
73
|
+
*
|
|
74
|
+
* Stores a lock mechanism in the base class lockMechanisms map for unified teardown (PubNub and polling).
|
|
75
|
+
* The lock mechanism must implement tearDownPubNubSubscription for proper cleanup.
|
|
77
76
|
* Overrides the HAP-based Lock() method from AugustPlatform.
|
|
78
77
|
*/
|
|
79
78
|
async Lock(device) {
|
|
80
79
|
const matterApi = this.api.matter;
|
|
81
80
|
if (!matterApi) {
|
|
82
|
-
await this.
|
|
81
|
+
await this.logger.error('Matter API is not available. Cannot register Matter accessory.');
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
84
|
const uuid = matterApi.uuid.generate(device.lockId);
|
|
@@ -92,7 +91,7 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
92
91
|
// subscription, they all need to go together when a lock is hidden or
|
|
93
92
|
// removed from the account.
|
|
94
93
|
await this.tearDownMatterLock(uuid, device.LockName, matterApi);
|
|
95
|
-
await this.
|
|
94
|
+
await this.logger.debugError(`Unable to Register: ${device.LockName}, Lock ID: ${device.lockId} Check Config to see if is being Hidden.`);
|
|
96
95
|
return;
|
|
97
96
|
}
|
|
98
97
|
const displayName = device.configLockName
|
|
@@ -131,11 +130,11 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
131
130
|
throw new Error('Connectivity not initialized');
|
|
132
131
|
}
|
|
133
132
|
await this.connectivity.execute(`Matter lockDoor ${device.lockId}`, client => client.lock(device.lockId), { throwOnOffline: true });
|
|
134
|
-
await this.
|
|
133
|
+
await this.logger.success(`Matter: Locked ${displayName}`);
|
|
135
134
|
await matterApi.updateAccessoryState(uuid, 'doorLock', { lockState: matterApi.types.DoorLock.LockState.Locked });
|
|
136
135
|
}
|
|
137
136
|
catch (e) {
|
|
138
|
-
await this.
|
|
137
|
+
await this.logger.error(`Matter: lockDoor failed: ${e.message ?? e}`);
|
|
139
138
|
}
|
|
140
139
|
},
|
|
141
140
|
unlockDoor: async () => {
|
|
@@ -145,21 +144,21 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
145
144
|
throw new Error('Connectivity not initialized');
|
|
146
145
|
}
|
|
147
146
|
await this.connectivity.execute(`Matter unlockDoor ${device.lockId}`, client => client.unlock(device.lockId), { throwOnOffline: true });
|
|
148
|
-
await this.
|
|
147
|
+
await this.logger.success(`Matter: Unlocked ${displayName}`);
|
|
149
148
|
await matterApi.updateAccessoryState(uuid, 'doorLock', { lockState: matterApi.types.DoorLock.LockState.Unlocked });
|
|
150
149
|
}
|
|
151
150
|
catch (e) {
|
|
152
|
-
await this.
|
|
151
|
+
await this.logger.error(`Matter: unlockDoor failed: ${e.message ?? e}`);
|
|
153
152
|
}
|
|
154
153
|
},
|
|
155
154
|
},
|
|
156
155
|
},
|
|
157
156
|
};
|
|
158
157
|
if (existingAccessory) {
|
|
159
|
-
await this.
|
|
158
|
+
await this.logger.info(`Restoring existing Matter accessory from cache: ${displayName}, Lock ID: ${device.lockId}`);
|
|
160
159
|
}
|
|
161
160
|
else {
|
|
162
|
-
await this.
|
|
161
|
+
await this.logger.info(`Adding new Matter accessory: ${displayName}, Lock ID: ${device.lockId}`);
|
|
163
162
|
}
|
|
164
163
|
// Register (or re-register to update handlers/context) with Homebridge Matter
|
|
165
164
|
await matterApi.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
|
|
@@ -167,57 +166,47 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
167
166
|
// After Matter registration succeeds, clean up any staged HAP accessory for this lock.
|
|
168
167
|
// This deferred removal ensures that if Matter registration had failed, the user would
|
|
169
168
|
// have kept the HAP accessory rather than being left with no accessory at all.
|
|
169
|
+
// --- PubNub subscription for push updates from August cloud ---
|
|
170
|
+
await this.subscribePubNub(device.lockId, async (event) => {
|
|
171
|
+
if (event && event.LockStatus && event.LockStatus.state) {
|
|
172
|
+
const lockState = this.mapLockState(event.LockStatus.state, matterApi);
|
|
173
|
+
await matterApi.updateAccessoryState(uuid, 'doorLock', { lockState });
|
|
174
|
+
await this.logger.debug(`Matter: PubNub push updated lockState to ${lockState} for ${displayName}`);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
170
177
|
const stagedHapAccessory = this.pendingHapCleanup.get(uuid);
|
|
171
178
|
if (stagedHapAccessory) {
|
|
172
179
|
this.log.debug(`Removing migrated HAP accessory after successful Matter registration: ${stagedHapAccessory.displayName}`);
|
|
173
180
|
this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [stagedHapAccessory]);
|
|
174
181
|
this.pendingHapCleanup.delete(uuid);
|
|
175
182
|
}
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
await this.augustCredentials();
|
|
189
|
-
if (this.config.credentials) {
|
|
190
|
-
// Tear down any previous subscription for this lock before creating a new one
|
|
191
|
-
// (defensive: makes this method safe to call on re-registration).
|
|
192
|
-
const existingUnsubscribe = this.matterPubNubUnsubscribes.get(uuid);
|
|
193
|
-
if (existingUnsubscribe) {
|
|
194
|
-
try {
|
|
195
|
-
existingUnsubscribe();
|
|
196
|
-
}
|
|
197
|
-
catch { /* ignore */ }
|
|
198
|
-
this.matterPubNubUnsubscribes.delete(uuid);
|
|
183
|
+
// Create a lock mechanism object for unified teardown (implements tearDownPubNubSubscription for base compatibility)
|
|
184
|
+
const mechanism = {
|
|
185
|
+
uuid,
|
|
186
|
+
device,
|
|
187
|
+
matterApi,
|
|
188
|
+
pollingSub: undefined,
|
|
189
|
+
tearDownPubNubSubscription: () => {
|
|
190
|
+
// Unsubscribe polling
|
|
191
|
+
const pollingSub = this.matterPollingSubscriptions.get(uuid);
|
|
192
|
+
if (pollingSub) {
|
|
193
|
+
pollingSub.unsubscribe();
|
|
194
|
+
this.matterPollingSubscriptions.delete(uuid);
|
|
199
195
|
}
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
try {
|
|
206
|
-
await matterApi.updateAccessoryState(uuid, 'doorLock', { lockState });
|
|
207
|
-
await this.debugLog(`Matter: Updated lockState to ${lockState} for ${device.LockName}`);
|
|
208
|
-
}
|
|
209
|
-
catch (e) {
|
|
210
|
-
await this.errorLog(`Matter: updateAccessoryState failed: ${e.message ?? e}`);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
if (typeof unsubscribe === 'function') {
|
|
215
|
-
this.matterPubNubUnsubscribes.set(uuid, unsubscribe);
|
|
196
|
+
// Unsubscribe PubNub (for test compatibility, even though not used in Matter)
|
|
197
|
+
const unsub = this.matterPubNubUnsubscribes.get(uuid);
|
|
198
|
+
if (unsub) {
|
|
199
|
+
unsub();
|
|
200
|
+
this.matterPubNubUnsubscribes.delete(uuid);
|
|
216
201
|
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
this.lockMechanisms.set(device.lockId, mechanism);
|
|
205
|
+
// Start polling for periodic status refresh (fires immediately at 0ms for accurate initial state)
|
|
206
|
+
const pollingSub = this.startMatterStatusPolling(device, uuid, matterApi);
|
|
207
|
+
if (pollingSub) {
|
|
208
|
+
this.matterPollingSubscriptions.set(uuid, pollingSub);
|
|
209
|
+
mechanism.pollingSub = pollingSub;
|
|
221
210
|
}
|
|
222
211
|
}
|
|
223
212
|
/**
|
|
@@ -248,7 +237,7 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
248
237
|
*/
|
|
249
238
|
async fetchAndUpdateMatterLockState(device, uuid, matterApi) {
|
|
250
239
|
if (!this.connectivity) {
|
|
251
|
-
await this.
|
|
240
|
+
await this.logger.debug('Matter: connectivity not initialized — skipping');
|
|
252
241
|
return;
|
|
253
242
|
}
|
|
254
243
|
const lockDetails = await this.connectivity.execute(`Matter poll ${device.lockId}`, client => client.details(device.lockId));
|
|
@@ -263,24 +252,23 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
263
252
|
}
|
|
264
253
|
const lockState = this.mapLockState(details.LockStatus.state, matterApi);
|
|
265
254
|
await matterApi.updateAccessoryState(uuid, 'doorLock', { lockState });
|
|
266
|
-
await this.
|
|
255
|
+
await this.logger.debug(`Matter: Poll updated lockState to ${lockState} for ${device.LockName}`);
|
|
267
256
|
}
|
|
268
257
|
/**
|
|
269
258
|
* Poll the August API for lock status at the configured refresh rate and update the Matter
|
|
270
259
|
* DoorLock state. Uses `timer(0, ...)` for an immediate first fetch (accurate initial state)
|
|
271
260
|
* and `exhaustMap` to prevent overlapping concurrent requests.
|
|
272
261
|
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
* the timer keeps firing forever even after the accessory is gone.
|
|
262
|
+
* Returns the polling subscription so it can be disposed by the lock mechanism's teardown method.
|
|
263
|
+
*
|
|
264
|
+
* @returns {Subscription | undefined} The polling subscription, or undefined if polling is disabled.
|
|
277
265
|
*/
|
|
278
266
|
startMatterStatusPolling(device, uuid, matterApi) {
|
|
279
267
|
const refreshRate = this.platformRefreshRate ?? 30;
|
|
280
268
|
if (refreshRate === 0) {
|
|
281
|
-
return;
|
|
269
|
+
return undefined;
|
|
282
270
|
}
|
|
283
|
-
//
|
|
271
|
+
// If a polling subscription already exists, dispose it before creating a new one
|
|
284
272
|
const existing = this.matterPollingSubscriptions.get(uuid);
|
|
285
273
|
if (existing) {
|
|
286
274
|
existing.unsubscribe();
|
|
@@ -290,27 +278,33 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
290
278
|
.pipe(exhaustMap(() => this.fetchAndUpdateMatterLockState(device, uuid, matterApi)))
|
|
291
279
|
.subscribe();
|
|
292
280
|
this.matterPollingSubscriptions.set(uuid, subscription);
|
|
281
|
+
return subscription;
|
|
293
282
|
}
|
|
294
283
|
/**
|
|
295
284
|
* Release all resources associated with a given Matter lock UUID:
|
|
296
|
-
* the registered Matter accessory
|
|
297
|
-
*
|
|
298
|
-
*
|
|
285
|
+
* the registered Matter accessory and the lock mechanism (PubNub/polling teardown).
|
|
286
|
+
*
|
|
287
|
+
* Finds the lock mechanism by UUID, calls its tearDownPubNubSubscription (for PubNub and polling),
|
|
288
|
+
* and removes it from the lockMechanisms map. Also unregisters the Matter accessory.
|
|
299
289
|
*/
|
|
300
290
|
async tearDownMatterLock(uuid, lockName, matterApi) {
|
|
301
|
-
//
|
|
291
|
+
// Use base class teardown for unified logic (calls tearDownPubNubSubscription on mechanism)
|
|
292
|
+
for (const [lockId, mechanism] of this.lockMechanisms.entries()) {
|
|
293
|
+
if (mechanism.uuid === uuid) {
|
|
294
|
+
this.tearDownLockMechanism(lockId);
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// If mechanism was not found, or if test sets up direct map entries, ensure teardown for polling and PubNub
|
|
299
|
+
// (test compatibility: always call and remove any teardown functions for this uuid)
|
|
302
300
|
const pollingSub = this.matterPollingSubscriptions.get(uuid);
|
|
303
301
|
if (pollingSub) {
|
|
304
302
|
pollingSub.unsubscribe();
|
|
305
303
|
this.matterPollingSubscriptions.delete(uuid);
|
|
306
304
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
try {
|
|
311
|
-
pubnubUnsubscribe();
|
|
312
|
-
}
|
|
313
|
-
catch { /* best-effort */ }
|
|
305
|
+
const unsub = this.matterPubNubUnsubscribes.get(uuid);
|
|
306
|
+
if (unsub) {
|
|
307
|
+
unsub();
|
|
314
308
|
this.matterPubNubUnsubscribes.delete(uuid);
|
|
315
309
|
}
|
|
316
310
|
// Registered Matter accessory
|
|
@@ -318,7 +312,7 @@ export class AugustMatterPlatform extends AugustPlatform {
|
|
|
318
312
|
if (staleAccessory) {
|
|
319
313
|
await matterApi.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [staleAccessory]);
|
|
320
314
|
this.matterAccessories.delete(uuid);
|
|
321
|
-
await this.
|
|
315
|
+
await this.logger.warn(`Removing stale Matter accessory: ${lockName}`);
|
|
322
316
|
}
|
|
323
317
|
}
|
|
324
318
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.matter.js","sourceRoot":"","sources":["../src/platform.matter.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"platform.matter.js","sourceRoot":"","sources":["../src/platform.matter.ts"],"names":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charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>default | @homebridge-plugins/homebridge-august</title><meta name="description" content="Documentation for @homebridge-plugins/homebridge-august"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@homebridge-plugins/homebridge-august</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">default</a></li></ul><h1>Variable default</h1></div><div class="tsd-signature"><span class="tsd-kind-variable">default</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">API</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="__type"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">API</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">api</span>: <span class="tsd-signature-type">API</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/homebridge-plugins/homebridge-august/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>default | @homebridge-plugins/homebridge-august</title><meta name="description" content="Documentation for @homebridge-plugins/homebridge-august"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@homebridge-plugins/homebridge-august</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">default</a></li></ul><h1>Variable default</h1></div><div class="tsd-signature"><span class="tsd-kind-variable">default</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">API</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="__type"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">API</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">api</span>: <span class="tsd-signature-type">API</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/homebridge-plugins/homebridge-august/blob/037fd62475c7abe0fc3ed48ecbe23d6f8ccce51d/src/index.ts#L26">index.ts:26</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@homebridge-plugins/homebridge-august</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@homebridge-plugins/homebridge-august",
|
|
3
3
|
"displayName": "August",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.3.0-beta.0",
|
|
6
6
|
"description": "The August plugin allows you to access your August & Yale device(s) from HomeKit.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "donavanbecker",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
],
|
|
39
39
|
"main": "dist/index.js",
|
|
40
40
|
"engines": {
|
|
41
|
-
"homebridge": "^
|
|
41
|
+
"homebridge": "^2.0.1",
|
|
42
42
|
"node": "^22 || ^24"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"check": "npm install && npm outdated",
|
|
46
|
-
"lint": "eslint src --no-warn-ignored",
|
|
47
|
-
"lint:fix": "eslint src --fix --no-warn-ignored",
|
|
46
|
+
"lint": "eslint 'src/**/*.ts' --no-warn-ignored",
|
|
47
|
+
"lint:fix": "eslint 'src/**/*.ts' --fix --no-warn-ignored",
|
|
48
48
|
"watch": "npm run build && npm run plugin-ui && npm link && nodemon",
|
|
49
49
|
"plugin-ui": "rsync ./src/homebridge-ui/public/index.html ./dist/homebridge-ui/public/",
|
|
50
50
|
"build": "npm run clean && tsc && npm run plugin-ui && cp package.json dist/package.json || true",
|
|
@@ -61,23 +61,25 @@
|
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
+
"@homebridge/plugin-logger": "^1.0.0",
|
|
64
65
|
"@homebridge/plugin-ui-utils": "^2.2.3",
|
|
65
66
|
"august-yale": "^1.2.2",
|
|
66
67
|
"rxjs": "^7.8.2"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@antfu/eslint-config": "^8.2.0",
|
|
70
|
-
"@types/node": "^25.6.
|
|
71
|
+
"@types/node": "^25.6.2",
|
|
71
72
|
"@vitest/coverage-v8": "^4.1.5",
|
|
72
73
|
"eslint": "^10.3.0",
|
|
73
74
|
"eslint-plugin-format": "^2.0.1",
|
|
74
|
-
"eslint-plugin-
|
|
75
|
+
"eslint-plugin-html": "^8.1.4",
|
|
76
|
+
"eslint-plugin-perfectionist": "^5.8.0",
|
|
75
77
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
76
|
-
"homebridge": "^2.0.
|
|
78
|
+
"homebridge": "^2.0.1",
|
|
77
79
|
"nodemon": "^3.1.14",
|
|
78
80
|
"shx": "^0.4.0",
|
|
79
81
|
"typedoc": "^0.28.19",
|
|
80
82
|
"typescript": "^6.0.3",
|
|
81
83
|
"vitest": "^4.1.5"
|
|
82
84
|
}
|
|
83
|
-
}
|
|
85
|
+
}
|