@homebridge-plugins/homebridge-august 3.3.0-beta.0 → 3.3.0-beta.1
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 +19 -14
- package/CLAUDE.md +48 -0
- package/README.md +39 -27
- package/config.schema.json +47 -3
- package/dist/Platform.HAP.d.ts +139 -20
- package/dist/Platform.HAP.d.ts.map +1 -1
- package/dist/Platform.HAP.js +732 -46
- package/dist/Platform.HAP.js.map +1 -1
- package/dist/connectivity-manager.d.ts +3 -3
- package/dist/connectivity-manager.d.ts.map +1 -1
- package/dist/connectivity-manager.js +14 -57
- package/dist/connectivity-manager.js.map +1 -1
- package/dist/devices/device.d.ts +16 -5
- package/dist/devices/device.d.ts.map +1 -1
- package/dist/devices/device.js +75 -18
- package/dist/devices/device.js.map +1 -1
- package/dist/devices/device.test.d.ts +2 -0
- package/dist/devices/device.test.d.ts.map +1 -0
- package/dist/devices/device.test.js +294 -0
- package/dist/devices/device.test.js.map +1 -0
- 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/platform.matter.d.ts +26 -18
- package/dist/platform.matter.d.ts.map +1 -1
- package/dist/platform.matter.js +95 -76
- package/dist/platform.matter.js.map +1 -1
- package/dist/settings.d.ts +1 -0
- package/dist/settings.d.ts.map +1 -1
- package/package.json +37 -32
- package/test/connectivity-manager.test.ts +592 -0
- package/test/platform.matter.test.ts +660 -0
- package/test/platform.polling.test.ts +5 -5
- package/test/{platform.hap.test.ts → platform.test.ts} +23 -23
- package/.github/FUNDING.yml +0 -4
- package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -97
- package/.github/ISSUE_TEMPLATE/config.yml +0 -8
- package/.github/ISSUE_TEMPLATE/feature-request.yml +0 -38
- package/.github/ISSUE_TEMPLATE/support-request.yml +0 -85
- package/.github/ISSUE_TEMPLATE.md +0 -48
- package/.github/PULL_REQUEST_TEMPLATE/pull_request.md +0 -27
- package/.github/copilot-instructions.md +0 -200
- package/.github/dependabot.yml +0 -17
- package/.github/labeler.yml +0 -38
- package/.github/npm-version-script-esm.js +0 -97
- package/.github/workflows/release.yml +0 -169
- package/.github/workflows/stale.yml +0 -12
- package/SECURITY.md +0 -19
- package/branding/Homebridge_x_August.svg +0 -32
- package/branding/icon.png +0 -0
- package/dist/Platform.Base.d.ts +0 -288
- package/dist/Platform.Base.d.ts.map +0 -1
- package/dist/Platform.Base.js +0 -797
- package/dist/Platform.Base.js.map +0 -1
- package/dist/package.json +0 -85
- package/docs/.nojekyll +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -22
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1633
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -44
- package/docs/modules.html +0 -1
- package/docs/variables/default.html +0 -1
- package/eslint.config.js +0 -47
- package/test/device.test.ts +0 -384
- package/vitest.config.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
##
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
## v3.3.0 (Pending Release)
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
- chore(deps): update dependencies
|
|
6
|
+
- chore: add .idea to .gitignore
|
|
7
|
+
- chore(github): align workflows, funding and issue templates with the other org plugins
|
|
8
|
+
- chore: align npm publishing files with the other org plugins
|
|
9
|
+
- chore: standardise the eslint setup with the other org plugins
|
|
10
|
+
- style: apply the standardised lint rules
|
|
11
|
+
- chore: standardise the package scripts and publishing config
|
|
12
|
+
- chore: sync the package version with the released v3.2.3
|
|
13
|
+
- chore: update the plugin metadata for the new maintainer
|
|
14
|
+
- docs: refresh the readme
|
|
15
|
+
- docs: add claude and copilot instructions files
|
|
16
|
+
- docs: use the standard org readme banner
|
|
17
|
+
- fix: keep matter display names within the 32 character limit
|
|
18
|
+
- chore(github): update the setup-node action to v7
|
|
19
|
+
- feat: add an account brand option so yale home and yale access accounts can sign in (#236) (@phattrance)
|
|
15
20
|
|
|
16
21
|
## [3.2.3](https://github.com/homebridge-plugins/homebridge-august/releases/tag/v3.2.3) (2026-05-04)
|
|
17
22
|
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- `npm run build` — `rimraf ./dist && tsc && npm run plugin-ui`. The `plugin-ui` step rsyncs `src/homebridge-ui/public/index.html` into `dist/` (the UI server itself is TypeScript and compiled by `tsc`). Skipping it produces a broken published package.
|
|
8
|
+
- `npm run lint` — ESLint over the whole repo with `--max-warnings=0`. CI fails on any warning. `npm run lint:fix` to autofix.
|
|
9
|
+
- `npm test` — vitest, test files live in `test/` (configured in `vitest.config.ts`). `npm run test:watch` and `npm run test-coverage` also available.
|
|
10
|
+
- `npm run watch` — build, `npm link`, then `nodemon`: recompiles and restarts `homebridge -U ./test/hbConfig -D` on `src/**/*.ts` changes. `./test/hbConfig` is gitignored; create it locally with a `config.json` containing August credentials.
|
|
11
|
+
- `npm run docs` — typedoc into `docs/` (gitignored — generated output is never committed).
|
|
12
|
+
- `npm run prepublishOnly` — lint then build; runs automatically on publish.
|
|
13
|
+
|
|
14
|
+
CI (`.github/workflows/build.yml`) runs install + lint on Node 22.x/24.x. Releases publish via `.github/workflows/release.yml`: a GitHub release (tag `vX.Y.Z`) publishes to npm's `latest` tag; pushes to `beta-X.Y.Z` / `alpha-X.Y.Z` branches publish incrementing prerelease versions to the `beta` / `alpha` tags.
|
|
15
|
+
|
|
16
|
+
Supported Node: `^22.12.0 || ^24.0.0`. Homebridge: `^2.0.0`.
|
|
17
|
+
|
|
18
|
+
## Architecture
|
|
19
|
+
|
|
20
|
+
Homebridge dynamic platform plugin (`platform: "August"`, package `@homebridge-plugins/homebridge-august`) bridging August and Yale locks into HomeKit via the August cloud API (the [august-yale](https://github.com/bdraco/august-yale) package).
|
|
21
|
+
|
|
22
|
+
### HAP/Matter platform selection (`src/index.ts`)
|
|
23
|
+
|
|
24
|
+
Registers a proxy constructor: `AugustMatterPlatform` (`src/platform.matter.ts`, extends `AugustPlatform`) is used automatically when Homebridge reports Matter available+enabled, unless `options.disableMatter` is set; otherwise the HAP `AugustPlatform` (`src/Platform.HAP.ts`). Note the auto-on default — the opposite of some sibling plugins where Matter is opt-in.
|
|
25
|
+
|
|
26
|
+
### Authentication
|
|
27
|
+
|
|
28
|
+
First run: the user configures their August e-mail/phone, restarts, August sends a verification code, the user enters it in the plugin settings and restarts again (`validateCode` flow in `Platform.HAP.ts`). Credentials are normalised by the platform and passed to `august-yale`'s `August` client.
|
|
29
|
+
|
|
30
|
+
### Connectivity manager (`src/connectivity-manager.ts`)
|
|
31
|
+
|
|
32
|
+
All August API calls should go through `this.connectivity.execute()` rather than calling the client directly — it classifies failures (`InvalidAuth`, `NetworkError`, `TimeoutError`, `AbortedError`) and drives a `healthy → degraded → offline → recovering` state machine with a backoff probe schedule (5s→300s) and an offline heartbeat. It rebuilds the `August` client on credential changes and re-authenticates on `InvalidAuth`. Locks subscribe to state changes to mark accessories unresponsive/responsive.
|
|
33
|
+
|
|
34
|
+
### Device classes (`src/devices/`)
|
|
35
|
+
|
|
36
|
+
`deviceBase` (`src/devices/device.ts`) wires per-device config (logging level, refresh/update/push rates) and the AccessoryInformation service. `LockMechanism` (`src/devices/lock.ts`) implements the lock, doorbell-adjacent contact sensor (DoorSense) and battery services. The HAP platform keeps instances in its `lockMechanisms` map keyed by accessory UUID. Lock state updates arrive via subscription pushes and a polling loop (`pollTimer` in `Platform.HAP.ts`).
|
|
37
|
+
|
|
38
|
+
### Logging
|
|
39
|
+
|
|
40
|
+
The platform and `deviceBase` expose leveled log helpers (`infoLog`, `warnLog`, `errorLog`, `debugLog`, …) gated by `config.options.logging` with per-device `logging` overrides. Use these instead of `this.log` directly so user log settings are respected.
|
|
41
|
+
|
|
42
|
+
## Conventions
|
|
43
|
+
|
|
44
|
+
- TypeScript ESM (`"type": "module"`): relative imports use `.js` extensions even from `.ts` source.
|
|
45
|
+
- ESLint is `@antfu/eslint-config` (flat config in `eslint.config.js`): single quotes, 1tbs braces, `curly` multi-line only, sorted exports. Run `npm run lint:fix` before committing.
|
|
46
|
+
- `config.schema.json` defines the Homebridge UI form and must stay in sync with the interfaces in `src/settings.ts` (`AugustPlatformConfig`, `devicesConfig`, `options`, `credentials`).
|
|
47
|
+
- Timer fields use `ReturnType<typeof setTimeout>` / `ReturnType<typeof setInterval>`, not `NodeJS.Timeout` (the lint setup has no Node globals).
|
|
48
|
+
- Copyright headers in `src/` credit @donavanbecker, the original plugin author — leave them in place.
|
package/README.md
CHANGED
|
@@ -1,45 +1,57 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/homebridge-plugins/homebridge-august"><img alt="homebridge-august" src="https://raw.githubusercontent.com/homebridge-plugins/homebridge-august/latest/branding/Homebridge_x_August.png" width="600px"></a>
|
|
3
|
+
</p>
|
|
1
4
|
<span align="center">
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# Homebridge August
|
|
6
|
+
## homebridge-august
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
<a href="https://www.npmjs.com/package/homebridge-august"><img title="npm downloads" src="https://badgen.net/npm/dt/homebridge-august?label=downloads" ></a>
|
|
9
|
-
<a href="https://discord.gg/8fpZA4S"><img title="discord-august" src="https://badgen.net/discord/online-members/8fpZA4S?icon=discord&label=discord" ></a>
|
|
10
|
-
<a href="https://paypal.me/donavanbecker"><img title="donate" src="https://badgen.net/badge/donate/paypal/yellow" ></a>
|
|
8
|
+
Homebridge plugin to integrate August and Yale locks into HomeKit
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
[](https://www.npmjs.com/package/@homebridge-plugins/homebridge-august)
|
|
11
|
+
[](https://github.com/homebridge/homebridge/wiki/How-to-Install-Alternate-Plugin-Versions)<br>
|
|
12
|
+
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)<br>
|
|
13
|
+
[](https://www.npmjs.com/package/@homebridge-plugins/homebridge-august)
|
|
14
|
+
[](https://discord.gg/bHjKNkN)
|
|
16
15
|
|
|
17
16
|
</span>
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
1. Search for "August" on the plugin screen of [Homebridge Config UI X](https://github.com/oznu/homebridge-config-ui-x).
|
|
22
|
-
2. Click **Install**.
|
|
23
|
-
|
|
24
|
-
## Configuration
|
|
18
|
+
### Plugin Information
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
- This plugin allows you to view and control your [August](https://august.com) and [Yale](https://shopyalehome.com) locks within HomeKit. The plugin:
|
|
21
|
+
- requires your August account credentials to work
|
|
22
|
+
- connects to the August cloud to discover and control your locks
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
### Setup
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
- Installation
|
|
27
|
+
- Search for "August" on the plugin screen of the [Homebridge UI](https://github.com/homebridge/homebridge-config-ui-x) and click **Install**.
|
|
28
|
+
- Configuration
|
|
29
|
+
1. Enter your August account e-mail or phone number in the plugin settings and restart Homebridge.
|
|
30
|
+
2. August will send you a verification code - enter this code in the plugin settings.
|
|
31
|
+
3. Restart Homebridge once more and your locks will appear.
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
### Supported Devices
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- August Smart lock (AUG-SL04-C03-N04)
|
|
37
|
-
- August Smart Lock Pro 3rd Gee (AUG-SL03-C02-G03-C)
|
|
35
|
+
- August Smart Lock (AUG-SL04-C03-N04)
|
|
36
|
+
- August Smart Lock Pro 3rd Gen (AUG-SL03-C02-G03-C)
|
|
38
37
|
- August WiFi Smart Lock (Gen 4)
|
|
39
38
|
- Yale Assure Lock (AUG-MD01)
|
|
40
39
|
- Yale Assure Lock 2 (YDR410)
|
|
41
40
|
- Yale Assure Lock SL (YDR256)
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
### Help/About
|
|
43
|
+
|
|
44
|
+
- [Support Request](https://github.com/homebridge-plugins/homebridge-august/issues/new/choose)
|
|
45
|
+
- [Changelog](https://github.com/homebridge-plugins/homebridge-august/blob/latest/CHANGELOG.md)
|
|
46
|
+
- [About Me](https://github.com/sponsors/bwp91)
|
|
47
|
+
|
|
48
|
+
### Credits
|
|
49
|
+
|
|
50
|
+
- To [@donavanbecker](https://github.com/donavanbecker): the original creator and maintainer of this plugin.
|
|
51
|
+
- To [@hufftheweevil](https://github.com/hufftheweevil): the author of the [august-api](https://github.com/hufftheweevil/august-api) module this plugin builds on.
|
|
52
|
+
- To the creators/contributors of [Homebridge](https://homebridge.io) who make this plugin possible.
|
|
53
|
+
|
|
54
|
+
### Disclaimer
|
|
44
55
|
|
|
45
|
-
|
|
56
|
+
- I am in no way affiliated with August or Yale and this plugin is a personal project that I maintain in my free time.
|
|
57
|
+
- Use this plugin entirely at your own risk - please see licence for more information.
|
package/config.schema.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"singular": true,
|
|
5
5
|
"customUi": true,
|
|
6
6
|
"customUiPath": "./dist/homebridge-ui",
|
|
7
|
-
"headerDisplay": "<p align='center'><img width='
|
|
8
|
-
"footerDisplay": "Please raise any issues on our [project page](https://github.com/homebridge-plugins/homebridge-august/issues).\n\nIf you would like to have other
|
|
7
|
+
"headerDisplay": "<p align='center'><img width='250px' src='https://raw.githubusercontent.com/homebridge-plugins/homebridge-august/latest/branding/Homebridge_x_August.png'></p>\n\nThe **August** plugin allows you to control August Devices. \n\nTo get started link your August Account.\n\n1. Input your August E-mail/Phone Number into the August Account Info.\n\n2.Restart Homebridge to receive an August Validate Code.\n\n3. Input your Validate Code into the August Account Info.\n\n4. Finally Restart Homebridge.",
|
|
8
|
+
"footerDisplay": "Please raise any issues on our [project page](https://github.com/homebridge-plugins/homebridge-august/issues).\n\nIf you would like to have other features, please open a [feature request](https://github.com/homebridge-plugins/homebridge-august/issues/new/choose).",
|
|
9
9
|
"schema": {
|
|
10
10
|
"type": "object",
|
|
11
11
|
"properties": {
|
|
@@ -125,6 +125,50 @@
|
|
|
125
125
|
"type": "select"
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
|
+
"brand": {
|
|
129
|
+
"title": "Account Brand",
|
|
130
|
+
"type": "string",
|
|
131
|
+
"default": "august",
|
|
132
|
+
"description": "The app your account belongs to. Pick 'Yale Home' if you use the Yale Home app (common outside North America).",
|
|
133
|
+
"condition": {
|
|
134
|
+
"functionBody": "return (model.credentials && model.credentials.augustId && model.credentials.password);"
|
|
135
|
+
},
|
|
136
|
+
"oneOf": [
|
|
137
|
+
{
|
|
138
|
+
"title": "August",
|
|
139
|
+
"enum": [
|
|
140
|
+
"august"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"title": "Yale Access",
|
|
145
|
+
"enum": [
|
|
146
|
+
"yale_access"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"title": "Yale Home",
|
|
151
|
+
"enum": [
|
|
152
|
+
"yale_home"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"title": "Yale Global",
|
|
157
|
+
"enum": [
|
|
158
|
+
"yale_global"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"title": "Yale August",
|
|
163
|
+
"enum": [
|
|
164
|
+
"yale_august"
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"x-schema-form": {
|
|
169
|
+
"type": "select"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
128
172
|
"apiKey": {
|
|
129
173
|
"type": "string",
|
|
130
174
|
"title": "apiKey",
|
|
@@ -521,4 +565,4 @@
|
|
|
521
565
|
]
|
|
522
566
|
}
|
|
523
567
|
]
|
|
524
|
-
}
|
|
568
|
+
}
|
package/dist/Platform.HAP.d.ts
CHANGED
|
@@ -1,27 +1,146 @@
|
|
|
1
|
-
import type { API } from 'homebridge';
|
|
2
|
-
import type { AugustPlatformConfig, device, devicesConfig } from './settings.js';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { API, DynamicPlatformPlugin, Logging, PlatformAccessory } from 'homebridge';
|
|
2
|
+
import type { AugustPlatformConfig, credentials, device, devicesConfig, options } from './settings.js';
|
|
3
|
+
import August from 'august-yale';
|
|
4
|
+
import { ConnectivityManager } from './connectivity-manager.js';
|
|
5
|
+
/**
|
|
6
|
+
* HomebridgePlatform
|
|
7
|
+
* This class is the main constructor for your plugin, this is where you should
|
|
8
|
+
* parse the user config and discover/register accessories with Homebridge.
|
|
9
|
+
*/
|
|
10
|
+
export declare class AugustPlatform implements DynamicPlatformPlugin {
|
|
11
|
+
accessories: PlatformAccessory[];
|
|
12
|
+
readonly api: API;
|
|
13
|
+
readonly log: Logging;
|
|
14
|
+
config: AugustPlatformConfig;
|
|
15
|
+
platformConfig: AugustPlatformConfig;
|
|
16
|
+
platformLogging: options['logging'];
|
|
17
|
+
platformRefreshRate: options['refreshRate'];
|
|
18
|
+
platformPushRate: options['pushRate'];
|
|
19
|
+
platformUpdateRate: options['updateRate'];
|
|
20
|
+
registeringDevice: boolean;
|
|
21
|
+
debugMode: boolean;
|
|
22
|
+
version: string;
|
|
23
|
+
augustConfig?: August;
|
|
24
|
+
connectivity?: ConnectivityManager;
|
|
25
|
+
private readonly lockMechanisms;
|
|
26
|
+
private pollTimer?;
|
|
27
|
+
private normalizedCredentialsCache?;
|
|
28
|
+
constructor(log: Logging, config: AugustPlatformConfig, api: API);
|
|
29
|
+
/**
|
|
30
|
+
* This function is invoked when homebridge restores cached accessories from disk at startup.
|
|
31
|
+
* It should be used to setup event handlers for characteristics and update respective values.
|
|
32
|
+
*/
|
|
33
|
+
configureAccessory(accessory: PlatformAccessory): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Verify the config passed to the plugin is valid
|
|
36
|
+
*/
|
|
37
|
+
verifyConfig(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* This method looks to see if session is already Validate, if not then sends a validateCode and saves the installId.
|
|
40
|
+
* After validateCode is saved to the config user must restart homebridge
|
|
41
|
+
* this process then looks to see if session is already validated and if the validateCode in config;
|
|
42
|
+
* if isValidated is false then it will validate iwth the validateCode and save isValidated as true in the config.json file
|
|
43
|
+
* will also make the validateCode undefined
|
|
44
|
+
*/
|
|
45
|
+
validated(): Promise<void>;
|
|
46
|
+
augustCredentials(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Normalize credentials for August API compatibility
|
|
49
|
+
* Handle country code variations that may cause 403 errors
|
|
50
|
+
* Maps regional country codes to supported API endpoints
|
|
51
|
+
*/
|
|
52
|
+
private normalizeCredentialsForApi;
|
|
53
|
+
/**
|
|
54
|
+
* Clear the normalized credentials cache
|
|
55
|
+
* Should be called when credentials are updated
|
|
56
|
+
*/
|
|
57
|
+
clearNormalizedCredentialsCache(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Public method to get normalized credentials for use by device classes
|
|
60
|
+
* Uses caching to avoid repeated normalization of the same credentials
|
|
61
|
+
*/
|
|
62
|
+
getNormalizedCredentials(): Promise<credentials>;
|
|
63
|
+
/**
|
|
64
|
+
* Start the platform-level poll cycle. Iterates registered locks
|
|
65
|
+
* SERIALLY (not in parallel) and short-circuits on the first failure.
|
|
66
|
+
*
|
|
67
|
+
* Why serial:
|
|
68
|
+
* - One outstanding request at a time on a healthy network is cheap
|
|
69
|
+
* enough (most cycles complete in <1s for a handful of locks) and
|
|
70
|
+
* avoids racing the August API.
|
|
71
|
+
* - On a failing network, a parallel cycle would produce N timeouts
|
|
72
|
+
* ~simultaneously, which is exactly the log-spam pattern the
|
|
73
|
+
* ConnectivityManager exists to prevent. Serial means one timeout,
|
|
74
|
+
* classified once, and the rest of the cycle aborts.
|
|
75
|
+
*
|
|
76
|
+
* Why short-circuit on first failure:
|
|
77
|
+
* - If the first call fails with a network error, the manager has
|
|
78
|
+
* already entered 'degraded' state and scheduled a probe. The
|
|
79
|
+
* remaining N-1 calls would all hit the same dead network and
|
|
80
|
+
* produce identical errors. Aborting the cycle is the correct
|
|
81
|
+
* thing to do.
|
|
10
82
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
83
|
+
* Why skip when offline:
|
|
84
|
+
* - The manager's state machine is already managing recovery via
|
|
85
|
+
* scheduled probes. Polling on top of that just wastes API calls
|
|
86
|
+
* and risks rate limiting.
|
|
87
|
+
*/
|
|
88
|
+
startPolling(): void;
|
|
89
|
+
/** Stop the platform poll cycle. Called from shutdown paths. */
|
|
90
|
+
stopPolling(): void;
|
|
91
|
+
pluginConfig(): Promise<{
|
|
92
|
+
pluginConfig: any;
|
|
93
|
+
currentConfig: any;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* This method is used to discover the your location and devices.
|
|
97
|
+
*/
|
|
98
|
+
discoverDevices(): Promise<void>;
|
|
99
|
+
protected Lock(device: device & devicesConfig): Promise<void>;
|
|
100
|
+
registerDevice(device: device & devicesConfig): Promise<boolean>;
|
|
101
|
+
externalOrPlatform(device: device & devicesConfig, accessory: PlatformAccessory): Promise<void>;
|
|
102
|
+
externalAccessory(accessory: PlatformAccessory): Promise<void>;
|
|
103
|
+
unregisterPlatformAccessories(existingAccessory: PlatformAccessory, device: device & devicesConfig): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Tear down the LockMechanism for a given lockId, releasing its PubNub
|
|
106
|
+
* subscription. Called when an accessory is unregistered (either via
|
|
107
|
+
* explicit removal or excludeLockIds config).
|
|
13
108
|
*/
|
|
14
|
-
|
|
109
|
+
private tearDownLockMechanism;
|
|
110
|
+
getPlatformLogSettings(): Promise<void>;
|
|
111
|
+
getPlatformRateSettings(): Promise<void>;
|
|
112
|
+
getPlatformConfigSettings(): Promise<void>;
|
|
15
113
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* and
|
|
114
|
+
* Asynchronously retrieves the version of the plugin from the package.json file.
|
|
115
|
+
*
|
|
116
|
+
* This method reads the package.json file located in the parent directory,
|
|
117
|
+
* parses its content to extract the version, and logs the version using the debug logger.
|
|
118
|
+
* The extracted version is then assigned to the `version` property of the class.
|
|
20
119
|
*
|
|
21
|
-
* @
|
|
22
|
-
|
|
23
|
-
|
|
120
|
+
* @returns {Promise<void>} A promise that resolves when the version has been retrieved and logged.
|
|
121
|
+
*/
|
|
122
|
+
getVersion(): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Validate and clean a string value for a Name Characteristic.
|
|
125
|
+
* @param displayName - The display name of the accessory.
|
|
126
|
+
* @param name - The name of the characteristic.
|
|
127
|
+
* @param value - The value to be validated and cleaned.
|
|
128
|
+
* @returns The cleaned string value.
|
|
129
|
+
*/
|
|
130
|
+
validateAndCleanDisplayName(displayName: string, name: string, value: string): Promise<string>;
|
|
131
|
+
/**
|
|
132
|
+
* If device level logging is turned on, log to log.warn
|
|
133
|
+
* Otherwise send debug logs to log.debug
|
|
24
134
|
*/
|
|
25
|
-
|
|
135
|
+
infoLog(...log: any[]): Promise<void>;
|
|
136
|
+
successLog(...log: any[]): Promise<void>;
|
|
137
|
+
debugSuccessLog(...log: any[]): Promise<void>;
|
|
138
|
+
warnLog(...log: any[]): Promise<void>;
|
|
139
|
+
debugWarnLog(...log: any[]): Promise<void>;
|
|
140
|
+
errorLog(...log: any[]): Promise<void>;
|
|
141
|
+
debugErrorLog(...log: any[]): Promise<void>;
|
|
142
|
+
debugLog(...log: any[]): Promise<void>;
|
|
143
|
+
loggingIsDebug(): Promise<boolean>;
|
|
144
|
+
enablingPlatformLogging(): Promise<boolean>;
|
|
26
145
|
}
|
|
27
146
|
//# sourceMappingURL=Platform.HAP.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Platform.HAP.d.ts","sourceRoot":"","sources":["../src/Platform.HAP.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Platform.HAP.d.ts","sourceRoot":"","sources":["../src/Platform.HAP.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAExF,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAKtG,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAI/D;;;;GAIG;AACH,qBAAa,cAAe,YAAW,qBAAqB;IACnD,WAAW,EAAE,iBAAiB,EAAE,CAAA;IACvC,SAAgB,GAAG,EAAE,GAAG,CAAA;IACxB,SAAgB,GAAG,EAAE,OAAO,CAAA;IACrB,MAAM,EAAG,oBAAoB,CAAA;IAEpC,cAAc,EAAG,oBAAoB,CAAA;IACrC,eAAe,EAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IACpC,mBAAmB,EAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC5C,gBAAgB,EAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACtC,kB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