@brandonarrindell/homebridge-envisalink 1.3.0 → 2.0.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/.github/workflows/build.yml +36 -21
- package/README.md +71 -2
- package/RELEASE_NOTES.md +91 -0
- package/config.schema.json +10 -3
- package/dist/configTypes.d.ts +4 -4
- package/dist/configTypes.d.ts.map +1 -1
- package/dist/customCommandAccessory.d.ts.map +1 -1
- package/dist/customCommandAccessory.js +5 -1
- package/dist/customCommandAccessory.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/names.d.ts +5 -0
- package/dist/names.d.ts.map +1 -0
- package/dist/names.js +45 -0
- package/dist/names.js.map +1 -0
- package/dist/networkScanner.js +18 -8
- package/dist/networkScanner.js.map +1 -1
- package/dist/panicAccessory.d.ts +1 -1
- package/dist/panicAccessory.d.ts.map +1 -1
- package/dist/panicAccessory.js +5 -1
- package/dist/panicAccessory.js.map +1 -1
- package/dist/partitionAccessory.d.ts.map +1 -1
- package/dist/partitionAccessory.js +7 -5
- package/dist/partitionAccessory.js.map +1 -1
- package/dist/platform.d.ts +1 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +75 -24
- package/dist/platform.js.map +1 -1
- package/dist/types.js +3 -3
- package/dist/types.js.map +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +3 -2
- package/dist/util.js.map +1 -1
- package/dist/zoneAccessory.d.ts.map +1 -1
- package/dist/zoneAccessory.js +6 -4
- package/dist/zoneAccessory.js.map +1 -1
- package/docs/testing.md +170 -0
- package/eslint.config.cjs +37 -0
- package/jest.config.ts +1 -1
- package/package.json +21 -18
- package/src/configTypes.ts +4 -4
- package/src/customCommandAccessory.ts +5 -1
- package/src/names.ts +42 -0
- package/src/networkScanner.ts +1 -1
- package/src/panicAccessory.ts +6 -2
- package/src/partitionAccessory.ts +7 -5
- package/src/platform.ts +60 -17
- package/src/util.ts +3 -2
- package/src/zoneAccessory.ts +6 -4
- package/test/customCommandAccessory.spec.ts +104 -0
- package/test/e2e/dsc-simulator.cjs +131 -0
- package/test/e2e/homebridge.test.cjs +622 -0
- package/test/e2e/loopback-only.cjs +30 -0
- package/test/names.spec.ts +70 -0
- package/test/networkScanner.spec.ts +6 -0
- package/.eslintrc.json +0 -38
|
@@ -1,31 +1,46 @@
|
|
|
1
|
-
name: Build and
|
|
1
|
+
name: Build, unit tests and simulated E2E
|
|
2
2
|
|
|
3
3
|
on: [push, pull_request]
|
|
4
4
|
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
|
|
5
8
|
jobs:
|
|
6
|
-
|
|
9
|
+
test:
|
|
7
10
|
runs-on: ubuntu-latest
|
|
8
|
-
|
|
9
11
|
strategy:
|
|
12
|
+
fail-fast: false
|
|
10
13
|
matrix:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
node: [22, 24]
|
|
15
|
+
homebridge: ['1.11.4', '2.4.0']
|
|
16
|
+
include:
|
|
17
|
+
# Current tooling with the oldest supported Node and Homebridge API.
|
|
18
|
+
- node: 24
|
|
19
|
+
homebridge: '1.6.0'
|
|
20
|
+
runtime-node: '22.0.0'
|
|
14
21
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
16
|
-
|
|
17
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
18
|
-
uses: actions/setup-node@v2
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: actions/setup-node@v4
|
|
19
24
|
with:
|
|
20
|
-
node-version: ${{ matrix.node
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- name:
|
|
26
|
-
run: npm run lint
|
|
27
|
-
|
|
28
|
-
- name: Build the project
|
|
29
|
-
run: npm run build
|
|
25
|
+
node-version: ${{ matrix.node }}
|
|
26
|
+
cache: npm
|
|
27
|
+
- run: npm ci
|
|
28
|
+
- run: npm run lint
|
|
29
|
+
- run: npm run test:unit
|
|
30
|
+
- name: Install isolated Homebridge test runtime
|
|
30
31
|
env:
|
|
31
|
-
|
|
32
|
+
HOMEBRIDGE_VERSION: ${{ matrix.homebridge }}
|
|
33
|
+
RUNTIME_NODE: ${{ matrix.runtime-node }}
|
|
34
|
+
run: |
|
|
35
|
+
npm install --prefix "$RUNNER_TEMP/envisalink-runtime" --no-package-lock --no-save "homebridge@$HOMEBRIDGE_VERSION"
|
|
36
|
+
HB_DIR="$RUNNER_TEMP/envisalink-runtime/node_modules/homebridge"
|
|
37
|
+
echo "HOMEBRIDGE_BIN=$HB_DIR/$(node -p "require('$HB_DIR/package.json').bin.homebridge")" >> "$GITHUB_ENV"
|
|
38
|
+
if [ -n "$RUNTIME_NODE" ]; then
|
|
39
|
+
npm install --prefix "$RUNNER_TEMP/envisalink-node" --no-package-lock --no-save "node@$RUNTIME_NODE"
|
|
40
|
+
echo "HOMEBRIDGE_NODE=$RUNNER_TEMP/envisalink-node/node_modules/node/bin/node" >> "$GITHUB_ENV"
|
|
41
|
+
fi
|
|
42
|
+
- name: Real Homebridge and simulated DSC TCP panel
|
|
43
|
+
run: npm run test:e2e
|
|
44
|
+
timeout-minutes: 8
|
|
45
|
+
- name: Production dependency audit
|
|
46
|
+
run: npm audit --omit=dev --audit-level=high
|
package/README.md
CHANGED
|
@@ -15,6 +15,11 @@ This Homebridge plugin integrates your Envisalink security system with HomeKit,
|
|
|
15
15
|
|
|
16
16
|
This fork continues from version 1.2.10 of the original plugin:
|
|
17
17
|
|
|
18
|
+
- v2.0.1 (2026-09-30) - Missing-name fallbacks, valid HomeKit names and cached
|
|
19
|
+
accessory-name repairs. See [upgrade and release notes](RELEASE_NOTES.md).
|
|
20
|
+
- v2.0.0 (2026-09-30) - Node.js 22/24 support, custom-command cache cleanup,
|
|
21
|
+
dependency refresh, and simulated end-to-end tests. **Breaking runtime change:**
|
|
22
|
+
see [migration and release notes](RELEASE_NOTES.md).
|
|
18
23
|
- v1.3.0 - First release of the fork
|
|
19
24
|
- Added Homebridge 2.0 support
|
|
20
25
|
- Added auto-discovery feature
|
|
@@ -34,7 +39,7 @@ For earlier version history, see the [original repository](https://github.com/du
|
|
|
34
39
|
|
|
35
40
|
🔒 **Core Features**
|
|
36
41
|
- Support for both Envisalink 3 and 4
|
|
37
|
-
- DSC
|
|
42
|
+
- DSC panel support (the current transport does not implement Honeywell TPI)
|
|
38
43
|
- Zone monitoring (doors, windows, motion, smoke, leak sensors)
|
|
39
44
|
- Multiple partition support
|
|
40
45
|
- Custom command support
|
|
@@ -56,6 +61,7 @@ Add to your Homebridge config.json:
|
|
|
56
61
|
"platforms": [
|
|
57
62
|
{
|
|
58
63
|
"platform": "Envisalink",
|
|
64
|
+
"name": "Envisalink",
|
|
59
65
|
"enableAutoDiscovery": true,
|
|
60
66
|
"host": "192.168.0.XXX", // Optional if enableAutoDiscovery is true
|
|
61
67
|
"deviceType": "DSC",
|
|
@@ -103,6 +109,7 @@ Add to your Homebridge config.json:
|
|
|
103
109
|
|
|
104
110
|
| Option | Type | Default | Description |
|
|
105
111
|
|--------|------|---------|-------------|
|
|
112
|
+
| name | string | "Envisalink" | Platform display name; set explicitly for a child bridge |
|
|
106
113
|
| enableAutoDiscovery | boolean | true | Automatically discover Envisalink devices |
|
|
107
114
|
| host | string | - | IP address of Envisalink (optional with auto-discovery) |
|
|
108
115
|
| deviceType | string | "DSC" | Panel type ("DSC" or "Honeywell") |
|
|
@@ -113,6 +120,37 @@ Add to your Homebridge config.json:
|
|
|
113
120
|
|
|
114
121
|
See [config.schema.json](./config.schema.json) for full configuration options.
|
|
115
122
|
|
|
123
|
+
### Display names and upgrading existing caches
|
|
124
|
+
|
|
125
|
+
Missing or blank partition names use numbered defaults (`Partition 1`,
|
|
126
|
+
`Partition 2`, etc.). Zone defaults use the actual zone number, including sparse
|
|
127
|
+
zones. Panic switches and custom commands also receive usable defaults. Names
|
|
128
|
+
are trimmed, unsupported symbols (such as emoji and `@`) become spaces, and names
|
|
129
|
+
are limited to 64 characters. Unicode letters and numbers, apostrophes and the
|
|
130
|
+
interior punctuation supported by current HAP-NodeJS are preserved. Only display
|
|
131
|
+
names change; partition/zone UUIDs, command-derived identities, service subtypes,
|
|
132
|
+
PINs and panel command strings keep their existing behavior.
|
|
133
|
+
|
|
134
|
+
For a child bridge, set the platform's `"name": "Envisalink"` explicitly in
|
|
135
|
+
Homebridge's configuration UI or JSON. An existing `"_bridge": { "name":
|
|
136
|
+
"Envisalink", ... }` overrides the platform display name. Replace an invalid
|
|
137
|
+
explicit `_bridge.name` too. Homebridge chooses this name **before** constructing
|
|
138
|
+
the plugin; the plugin's runtime fallback cannot repair that bridge itself.
|
|
139
|
+
Keep the existing `_bridge.username` and other bridge settings when renaming it.
|
|
140
|
+
The npm identifier remains `@brandonarrindell/homebridge-envisalink`; use a display
|
|
141
|
+
name rather than changing the package or platform identifier.
|
|
142
|
+
|
|
143
|
+
On the first startup with an old invalid cache, Homebridge 2 can warn while
|
|
144
|
+
loading that cache before the plugin receives its accessories. The plugin updates
|
|
145
|
+
the restored accessory, Accessory Information, sensor, security, chime, bypass,
|
|
146
|
+
panic and custom-command names and saves them in place. Cached names are also
|
|
147
|
+
normalized before DSC status arrives, including inactive controls. Active
|
|
148
|
+
accessories receive their configured names after DSC initialization.
|
|
149
|
+
After a normal restart, the repaired cache should load without those
|
|
150
|
+
naming warnings. UUIDs and HomeKit AIDs remain stable; deleting the cache or
|
|
151
|
+
unpairing the bridge is unnecessary. This does not test Apple Home's own cached
|
|
152
|
+
labels or pairing behavior.
|
|
153
|
+
|
|
116
154
|
## Auto-Discovery
|
|
117
155
|
|
|
118
156
|
The auto-discovery feature scans your network for Envisalink devices:
|
|
@@ -189,6 +227,37 @@ Add custom panel commands:
|
|
|
189
227
|
}
|
|
190
228
|
```
|
|
191
229
|
|
|
230
|
+
## Custom command changes
|
|
231
|
+
|
|
232
|
+
Custom command identities remain based on their command string for compatibility
|
|
233
|
+
with existing HomeKit installations. Renaming a command preserves its accessory.
|
|
234
|
+
Editing its command string replaces that accessory and removes the old tile;
|
|
235
|
+
HomeKit room assignments and automations referencing the old command may need to
|
|
236
|
+
be updated. Removing commands (including clearing or omitting `customCommands`)
|
|
237
|
+
removes their cached accessories on the next successful platform startup.
|
|
238
|
+
Previously orphaned command switches are recognized from their persisted serial
|
|
239
|
+
number and matching UUID, without deleting unrelated accessories.
|
|
240
|
+
|
|
241
|
+
## Development and testing
|
|
242
|
+
|
|
243
|
+
Use Node.js 22.13+ or 24 for development tooling, then run:
|
|
244
|
+
|
|
245
|
+
```sh
|
|
246
|
+
npm ci
|
|
247
|
+
npm run check
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
`npm test` runs both unit tests and real Homebridge-process tests against a local
|
|
251
|
+
simulated DSC EnvisaLink TCP panel. No alarm hardware, Home app pairing, or real
|
|
252
|
+
alarm credentials are needed. The simulator binds only to loopback and uses
|
|
253
|
+
temporary Homebridge storage. See [the testing guide](docs/testing.md) for protocol
|
|
254
|
+
sources, coverage, runtime overrides, and important simulation limits.
|
|
255
|
+
|
|
256
|
+
Version 2 requires Node.js 22 or 24. CI runs the simulator against Homebridge 1
|
|
257
|
+
and 2 on both Node versions, and checks the Homebridge 1.6 API floor on Node 22.0.0.
|
|
258
|
+
Upgrade older Node installations before installing version 2; see the
|
|
259
|
+
[migration notes](RELEASE_NOTES.md). The Homebridge engine range is unchanged.
|
|
260
|
+
|
|
192
261
|
## Contributing
|
|
193
262
|
|
|
194
263
|
1. Fork the repository
|
|
@@ -204,4 +273,4 @@ Add custom panel commands:
|
|
|
204
273
|
|
|
205
274
|
## License
|
|
206
275
|
|
|
207
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
276
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
package/RELEASE_NOTES.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# 2.0.1 — 2026-09-30
|
|
2
|
+
|
|
3
|
+
## Fixed
|
|
4
|
+
|
|
5
|
+
- Publish partitions with numbered fallback names when their configured names
|
|
6
|
+
are missing, empty or whitespace (issue #45)
|
|
7
|
+
- Normalize accessory and service names using current HAP Unicode and
|
|
8
|
+
punctuation rules, including trailing-space names such as `Smoke detector `
|
|
9
|
+
(issue #74)
|
|
10
|
+
- Repair restored accessory, Accessory Information, service and existing
|
|
11
|
+
ConfiguredName values while preserving UUIDs, HomeKit AIDs and panel commands
|
|
12
|
+
- Apply the platform-name fallback and expose its supported configuration field
|
|
13
|
+
- Persist repaired names on the Homebridge 1.6 compatibility floor as well as
|
|
14
|
+
current Homebridge 1 and 2 releases
|
|
15
|
+
|
|
16
|
+
## Upgrading
|
|
17
|
+
|
|
18
|
+
Set a valid platform `name`, such as `"name": "Envisalink"`, or an explicit
|
|
19
|
+
`_bridge.name` when using a child bridge. Homebridge selects the child-bridge name
|
|
20
|
+
before constructing the plugin, so the plugin's runtime fallback cannot repair
|
|
21
|
+
the preselected scoped-package default. Keep the existing bridge username,
|
|
22
|
+
settings and accessory cache to preserve HomeKit identity.
|
|
23
|
+
|
|
24
|
+
Homebridge may emit invalid-name warnings while deserializing an old cache before
|
|
25
|
+
plugin callbacks run. The plugin repairs and saves those names; the next restart
|
|
26
|
+
uses the repaired cache. Apple Home's own cached labels and pairing UI are outside
|
|
27
|
+
the simulated tests.
|
|
28
|
+
|
|
29
|
+
The Node.js 22/24 requirement introduced in 2.0.0 is unchanged.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Real Homebridge-process, simulated DSC TCP panel and HAP HTTP tests cover absent
|
|
34
|
+
and malformed names, legacy cache upgrades, main and child bridges, actual
|
|
35
|
+
restarts, stable identities and restored controls across every accessory type.
|
|
36
|
+
They include the production 60-second reconnect delay and the Homebridge 1.6 /
|
|
37
|
+
Node 22.0.0 compatibility floor. Test-port selection uses Node's uniform
|
|
38
|
+
`crypto.randomInt` API. See [testing documentation](docs/testing.md) for scope.
|
|
39
|
+
|
|
40
|
+
# 2.0.0 — 2026-09-30
|
|
41
|
+
|
|
42
|
+
## Breaking change: Node.js 22 or 24 required
|
|
43
|
+
|
|
44
|
+
This is a **major-version update**, not a patch release. Upgrade older Node.js
|
|
45
|
+
installations before installing version 2. Node.js 14–21 are no longer supported;
|
|
46
|
+
odd-numbered and other untested runtime lines are outside the supported range.
|
|
47
|
+
Homebridge's API compatibility range remains `^1.6.0 || ^2.0.0-beta.0`.
|
|
48
|
+
|
|
49
|
+
Use [Homebridge's official Node update instructions](https://github.com/homebridge/homebridge/wiki/How-To-Update-Node.js).
|
|
50
|
+
Back up Homebridge configuration and cached accessories first, upgrade Node, then
|
|
51
|
+
install the plugin update and verify your alarm's normal operation. Do not delete
|
|
52
|
+
the accessory cache as an upgrade step. Installations that cannot upgrade Node
|
|
53
|
+
must stay on the older plugin release until their runtime is upgraded.
|
|
54
|
+
|
|
55
|
+
This follows Homebridge's currently supported LTS Node lines. It also makes the
|
|
56
|
+
engine declaration honest about the refreshed production dependency tree:
|
|
57
|
+
NodeAlarmProxy's Winston/diagnostics dependencies now include code that fails to
|
|
58
|
+
load on Node 14. We do not freeze the entire published dependency tree or rely on
|
|
59
|
+
root-only overrides that would not protect consumers.
|
|
60
|
+
|
|
61
|
+
## Fixed
|
|
62
|
+
|
|
63
|
+
- Remove orphaned custom-command switches when commands are edited or removed,
|
|
64
|
+
including when the command list is empty or omitted (issue #77)
|
|
65
|
+
- Recognize previously unmarked cached commands using their persisted serial
|
|
66
|
+
number and exact command-derived UUID, while preserving unrelated accessories
|
|
67
|
+
- Preserve existing UUIDs and HomeKit identities for unchanged commands; renaming
|
|
68
|
+
changes both visible names without replacing the accessory
|
|
69
|
+
- Ignore duplicate command strings deterministically instead of rebinding twice
|
|
70
|
+
|
|
71
|
+
Editing a command string still creates a new accessory, as it did before. The old
|
|
72
|
+
one is now removed correctly. Reassign its HomeKit room and update automations
|
|
73
|
+
that referenced the replaced command if necessary. A name-only edit preserves
|
|
74
|
+
those existing references.
|
|
75
|
+
|
|
76
|
+
## Maintenance and verification
|
|
77
|
+
|
|
78
|
+
- Refresh production/transitive dependencies and compatible development tooling
|
|
79
|
+
- Remove the unnecessary npm `net` package; networking still uses Node's built-in
|
|
80
|
+
module
|
|
81
|
+
- Migrate ESLint to flat configuration and remove forced Jest exit; tests clean up
|
|
82
|
+
their timers instead
|
|
83
|
+
- Add real Homebridge-process, simulated DSC TCP panel and HAP HTTP tests, with
|
|
84
|
+
persisted cache restarts and the production reconnect delay
|
|
85
|
+
- Run reproducible installs, lint, unit tests, simulation and production audit in
|
|
86
|
+
CI on Node 22/24 with Homebridge 1/2, plus the Homebridge 1.6 API floor
|
|
87
|
+
|
|
88
|
+
See [testing documentation](docs/testing.md) for protocol sources and limitations.
|
|
89
|
+
The transport implements DSC TPI, not Honeywell TPI; the former README claim of
|
|
90
|
+
Honeywell support was incorrect. Simulated tests do not certify real alarm
|
|
91
|
+
hardware, Apple Home pairing, dispatch, or every firmware/protocol edge case.
|
package/config.schema.json
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
"schema": {
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"title": "Platform Name",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"required": false,
|
|
11
|
+
"default": "Envisalink",
|
|
12
|
+
"description": "Display name for this platform and its default child bridge. Set Envisalink explicitly when using a child bridge; Homebridge chooses the bridge name before loading the plugin."
|
|
13
|
+
},
|
|
7
14
|
"host": {
|
|
8
15
|
"title": "Host/IP Address",
|
|
9
16
|
"type": "string",
|
|
@@ -125,8 +132,8 @@
|
|
|
125
132
|
"name": {
|
|
126
133
|
"title": "Name",
|
|
127
134
|
"type": "string",
|
|
128
|
-
"description": "Distinguish between partitions
|
|
129
|
-
"required":
|
|
135
|
+
"description": "Distinguish between partitions (e.g. Upstairs/Downstairs). Missing, empty or unusable names default to Partition 1, Partition 2, etc.",
|
|
136
|
+
"required": false
|
|
130
137
|
},
|
|
131
138
|
"enableChimeSwitch": {
|
|
132
139
|
"title": "Enable Chime Switch",
|
|
@@ -237,4 +244,4 @@
|
|
|
237
244
|
}
|
|
238
245
|
}
|
|
239
246
|
}
|
|
240
|
-
}
|
|
247
|
+
}
|
package/dist/configTypes.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { PlatformConfig } from 'homebridge';
|
|
2
2
|
import { ZoneType } from './types';
|
|
3
3
|
export type PartitionConfig = {
|
|
4
|
-
name
|
|
4
|
+
name?: string;
|
|
5
5
|
enableChimeSwitch?: boolean;
|
|
6
6
|
pin?: string;
|
|
7
7
|
};
|
|
8
8
|
export type ZoneConfig = {
|
|
9
|
-
name
|
|
9
|
+
name?: string;
|
|
10
10
|
partition: number;
|
|
11
11
|
zoneNumber: number;
|
|
12
12
|
type: ZoneType;
|
|
13
13
|
};
|
|
14
14
|
export type PanicConfig = {
|
|
15
15
|
enabled: boolean;
|
|
16
|
-
name
|
|
16
|
+
name?: string;
|
|
17
17
|
};
|
|
18
18
|
export type CustomCommandConfig = {
|
|
19
|
-
name
|
|
19
|
+
name?: string;
|
|
20
20
|
command: string;
|
|
21
21
|
};
|
|
22
22
|
export type EnvisalinkConfig = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configTypes.d.ts","sourceRoot":"","sources":["../src/configTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"configTypes.d.ts","sourceRoot":"","sources":["../src/configTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,CA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iBAAiB,EAAU,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAC,4BAA4B,EAAC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"customCommandAccessory.d.ts","sourceRoot":"","sources":["../src/customCommandAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAU,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAC,4BAA4B,EAAC,MAAM,YAAY,CAAC;AAIxD;;;;GAIG;AACH,qBAAa,gCAAgC;IAIrC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAGb,QAAQ,EAAE,4BAA4B,EACtC,SAAS,EAAE,iBAAiB,EAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM;IAmB9B,aAAa,CAAC,KAAK,EAAE,mBAAmB;CAkBjD"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EnvisalinkCustomCommandAccessory = void 0;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
|
+
const names_1 = require("./names");
|
|
5
6
|
/**
|
|
6
7
|
* Platform Accessory
|
|
7
8
|
* An instance of this class is created for each accessory your platform registers
|
|
@@ -13,14 +14,17 @@ class EnvisalinkCustomCommandAccessory {
|
|
|
13
14
|
this.accessory = accessory;
|
|
14
15
|
this.name = name;
|
|
15
16
|
this.command = command;
|
|
17
|
+
(0, names_1.updateAccessoryName)(this.accessory, this.name, this.platform.Characteristic);
|
|
16
18
|
const infoService = this.accessory.getService(this.platform.Service.AccessoryInformation);
|
|
17
19
|
if (infoService) {
|
|
18
|
-
infoService.setCharacteristic(this.platform.Characteristic.
|
|
20
|
+
infoService.setCharacteristic(this.platform.Characteristic.Name, this.name)
|
|
21
|
+
.setCharacteristic(this.platform.Characteristic.Manufacturer, constants_1.MANUFACTURER)
|
|
19
22
|
.setCharacteristic(this.platform.Characteristic.Model, constants_1.MODEL)
|
|
20
23
|
.setCharacteristic(this.platform.Characteristic.SerialNumber, command);
|
|
21
24
|
}
|
|
22
25
|
this.service = this.accessory.getService(this.platform.Service.Switch) ||
|
|
23
26
|
this.accessory.addService(this.platform.Service.Switch, this.name);
|
|
27
|
+
(0, names_1.updateServiceName)(this.service, this.name, this.platform.Characteristic);
|
|
24
28
|
this.service.getCharacteristic(this.platform.Characteristic.On)
|
|
25
29
|
.onSet(this.invokeCommand.bind(this));
|
|
26
30
|
this.service.updateCharacteristic(this.platform.Characteristic.On, false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customCommandAccessory.js","sourceRoot":"","sources":["../src/customCommandAccessory.ts"],"names":[],"mappings":";;;AAGA,2CAAgD;
|
|
1
|
+
{"version":3,"file":"customCommandAccessory.js","sourceRoot":"","sources":["../src/customCommandAccessory.ts"],"names":[],"mappings":";;;AAGA,2CAAgD;AAChD,mCAA+D;AAE/D;;;;GAIG;AACH,MAAa,gCAAgC;IAGzC,YACqB,QAAsC,EACtC,SAA4B,EAC5B,IAAY,EACZ,OAAe;QAHf,aAAQ,GAAR,QAAQ,CAA8B;QACtC,cAAS,GAAT,SAAS,CAAmB;QAC5B,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QAEhC,IAAA,2BAAmB,EAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC7E,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAC1F,IAAI,WAAW,EAAE,CAAC;YACd,WAAW,CAAC,iB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AC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvD,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;YACvE,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QACrE,CAAC;gBAAS,CAAC;YACP,gDAAgD;YAChD,UAAU,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;YAC9E,CAAC,EAAE,IAAI,CAAC,CAAC;QACb,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA5CD,4EA4CC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAK/B;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAK/B;;GAEG;yBACO,KAAK,GAAG;AAAlB,kBAEE"}
|
package/dist/names.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Characteristic, PlatformAccessory, Service } from 'homebridge';
|
|
2
|
+
export declare function normalizeName(value: unknown, fallback: string): string;
|
|
3
|
+
export declare function updateServiceName(service: Service, name: string, characteristic: typeof Characteristic): void;
|
|
4
|
+
export declare function updateAccessoryName(accessory: PlatformAccessory, name: string, characteristic: typeof Characteristic): void;
|
|
5
|
+
//# sourceMappingURL=names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../src/names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAItE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAStE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,cAAc,GAAG,IAAI,CAM7G;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,cAAc,GAAG,IAAI,CAkB3H"}
|
package/dist/names.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeName = normalizeName;
|
|
4
|
+
exports.updateServiceName = updateServiceName;
|
|
5
|
+
exports.updateAccessoryName = updateAccessoryName;
|
|
6
|
+
// Match the Unicode letters/numbers and interior punctuation accepted by current
|
|
7
|
+
// HAP-NodeJS. Never apply this to plugin identifiers, UUID seeds or panel commands.
|
|
8
|
+
function normalizeName(value, fallback) {
|
|
9
|
+
const name = (typeof value === 'string' ? value : '').normalize('NFC')
|
|
10
|
+
.replace(/[^\p{L}\p{N}\p{Zs}\u2019'&!._:;()/,-]+/gu, ' ')
|
|
11
|
+
.replace(/\p{Zs}+/gu, ' ')
|
|
12
|
+
.slice(0, 64)
|
|
13
|
+
.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, '');
|
|
14
|
+
// HAP's current validator also requires at least two letters/numbers at the
|
|
15
|
+
// edges (a single-character name does not match its expression).
|
|
16
|
+
return /^[\p{L}\p{N}][\p{L}\p{N}\p{Zs}\u2019'&!._:;()/,-]*[\p{L}\p{N}]$/u.test(name) ? name : fallback;
|
|
17
|
+
}
|
|
18
|
+
function updateServiceName(service, name, characteristic) {
|
|
19
|
+
service.displayName = name;
|
|
20
|
+
service.setCharacteristic(characteristic.Name, name);
|
|
21
|
+
if (service.testCharacteristic(characteristic.ConfiguredName)) {
|
|
22
|
+
service.setCharacteristic(characteristic.ConfiguredName, name);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function updateAccessoryName(accessory, name, characteristic) {
|
|
26
|
+
// updateDisplayName was added after the supported Homebridge 1.6 API floor.
|
|
27
|
+
if (typeof accessory.updateDisplayName === 'function') {
|
|
28
|
+
accessory.updateDisplayName(name);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
accessory.displayName = name;
|
|
32
|
+
// Homebridge 1.6 serializes the HAP object rather than the public mirror.
|
|
33
|
+
// Its API has no display-name setter; keep this compatibility access
|
|
34
|
+
// isolated here. Later versions use their public setter above.
|
|
35
|
+
const legacy = accessory;
|
|
36
|
+
if (legacy._associatedHAPAccessory) {
|
|
37
|
+
legacy._associatedHAPAccessory.displayName = name;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const information = accessory.services.find(service => service.UUID === '0000003E-0000-1000-8000-0026BB765291');
|
|
41
|
+
if (information) {
|
|
42
|
+
updateServiceName(information, name, characteristic);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../src/names.ts"],"names":[],"mappings":";;AAIA,sCASC;AAED,8CAMC;AAED,kDAkBC;AAvCD,iFAAiF;AACjF,oFAAoF;AACpF,SAAgB,aAAa,CAAC,KAAc,EAAE,QAAgB;IAC1D,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;S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AAC,IAAI,KAAK,sCAAsC,CAAC,CAAC;IAChH,IAAI,WAAW,EAAE,CAAC;QACd,iBAAiB,CAAC,WAAW,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;AACL,CAAC"}
|
package/dist/networkScanner.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.EnvisalinkNetworkScanner = void 0;
|
|
27
37
|
const net = __importStar(require("net"));
|
|
@@ -155,7 +165,7 @@ class EnvisalinkNetworkScanner {
|
|
|
155
165
|
try {
|
|
156
166
|
socket.connect(port, ip);
|
|
157
167
|
}
|
|
158
|
-
catch (
|
|
168
|
+
catch (_a) {
|
|
159
169
|
cleanup();
|
|
160
170
|
resolve(false);
|
|
161
171
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networkScanner.js","sourceRoot":"","sources":["../src/networkScanner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"networkScanner.js","sourceRoot":"","sources":["../src/networkScanner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,uCAAyB;AAGzB,MAAa,wBAAwB;IAKjC,YAAY,GAAW;QAJN,gBAAW,GAAG,IAAI,CAAC;QACnB,sBAAiB,GAAG,IAAI,CAAC,CAAC,mBAAmB;QAI1D,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,OAAe,IAAI,CAAC,WAAW;QACjD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gDAAgD,IAAI,KAAK,CAAC,CAAC;QAEzE,6BAA6B;QAC7B,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACtD,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;YACnE,OAAO,EAAE,CAAC;QACd,CAAC;QAED,gCAAgC;QAChC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAC1D,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAClE,CAAC;QAEF,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAErD,4CAA4C;QAC5C,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAEvD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAA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QAC1B,OAAO;YACH,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG;YAClB,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG;YAClB,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,GAAG;YACjB,GAAG,GAAG,GAAG;SACZ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,EAAY;QAC3B,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACJ;AA9MD,4DA8MC"}
|
package/dist/panicAccessory.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class EnvisalinkPanicAccessory {
|
|
|
16
16
|
private readonly accessory;
|
|
17
17
|
private readonly config;
|
|
18
18
|
constructor(platform: EnvisalinkHomebridgePlatform, accessory: PlatformAccessory, config: EnvisalinkConfig);
|
|
19
|
-
bindPanicSwitch(panicType: PanicType, name
|
|
19
|
+
bindPanicSwitch(panicType: PanicType, name?: string): void;
|
|
20
20
|
activatePanic(panicType: PanicType, service: Service, value: CharacteristicValue): Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panicAccessory.d.ts","sourceRoot":"","sources":["../src/panicAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAC,4BAA4B,EAAC,MAAM,YAAY,CAAC;AAExD,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"panicAccessory.d.ts","sourceRoot":"","sources":["../src/panicAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAE3E,OAAO,EAAC,4BAA4B,EAAC,MAAM,YAAY,CAAC;AAExD,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAG/C,aAAK,SAAS;IACV,IAAI,IAAI;IACR,SAAS,IAAI;IACb,MAAM,IAAI;CACb;AAID;;;;GAIG;AACH,qBAAa,wBAAwB;IAE7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,QAAQ,EAAE,4BAA4B,EACtC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,gBAAgB;IAgB7C,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAmBpD,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB;CAgBzF"}
|
package/dist/panicAccessory.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EnvisalinkPanicAccessory = void 0;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
|
+
const names_1 = require("./names");
|
|
5
6
|
var PanicType;
|
|
6
7
|
(function (PanicType) {
|
|
7
8
|
PanicType[PanicType["Fire"] = 1] = "Fire";
|
|
@@ -20,6 +21,7 @@ class EnvisalinkPanicAccessory {
|
|
|
20
21
|
this.platform = platform;
|
|
21
22
|
this.accessory = accessory;
|
|
22
23
|
this.config = config;
|
|
24
|
+
(0, names_1.updateAccessoryName)(this.accessory, 'Panic', this.platform.Characteristic);
|
|
23
25
|
if ((_a = config.firePanic) === null || _a === void 0 ? void 0 : _a.enabled) {
|
|
24
26
|
this.bindPanicSwitch(PanicType.Fire, config.firePanic.name);
|
|
25
27
|
}
|
|
@@ -38,9 +40,11 @@ class EnvisalinkPanicAccessory {
|
|
|
38
40
|
.setCharacteristic(this.platform.Characteristic.SerialNumber, 'Panic');
|
|
39
41
|
}
|
|
40
42
|
const panicTypeString = PanicType[panicType];
|
|
43
|
+
const displayName = (0, names_1.normalizeName)(name, `${panicTypeString} Panic`);
|
|
41
44
|
const panicServiceId = `${PANIC_SERVICE_NAME}.${panicTypeString}`;
|
|
42
45
|
const panicService = this.accessory.getService(panicServiceId) ||
|
|
43
|
-
this.accessory.addService(this.platform.Service.Switch,
|
|
46
|
+
this.accessory.addService(this.platform.Service.Switch, displayName, panicServiceId);
|
|
47
|
+
(0, names_1.updateServiceName)(panicService, displayName, this.platform.Characteristic);
|
|
44
48
|
panicService.getCharacteristic(this.platform.Characteristic.On)
|
|
45
49
|
.onSet(this.activatePanic.bind(this, panicType, panicService));
|
|
46
50
|
panicService.updateCharacteristic(this.platform.Characteristic.On, false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panicAccessory.js","sourceRoot":"","sources":["../src/panicAccessory.ts"],"names":[],"mappings":";;;AAGA,2CAAgD;
|
|
1
|
+
{"version":3,"file":"panicAccessory.js","sourceRoot":"","sources":["../src/panicAccessory.ts"],"names":[],"mappings":";;;AAGA,2CAAgD;AAEhD,mCAA8E;AAE9E,IAAK,SAIJ;AAJD,WAAK,SAAS;IACV,yCAAQ,CAAA;IACR,mDAAa,CAAA;IACb,6CAAU,CAAA;AACd,CAAC,EAJI,SAAS,KAAT,SAAS,QAIb;AAED,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEnC;;;;GAIG;AACH,MAAa,wBAAwB;IACjC,YACqB,QAAsC,EACtC,SAA4B,EAC5B,MAAwB;;QAFxB,aAAQ,GAAR,QAAQ,CAA8B;QACtC,cAAS,GAAT,SAAS,CAAmB;QAC5B,WAAM,GAAN,MAAM,CAAkB;QAEzC,IAAA,2BAAmB,EAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC3E,IAAI,MAAA,MAAM,CAAC,SAAS,0CAAE,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC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AAC;QACzE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;CACJ;AAvDD,4DAuDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partitionAccessory.d.ts","sourceRoot":"","sources":["../src/partitionAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAElE,OAAO,EAAC,4BAA4B,EAAmB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"partitionAccessory.d.ts","sourceRoot":"","sources":["../src/partitionAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAElE,OAAO,EAAC,4BAA4B,EAAmB,MAAM,YAAY,CAAC;AAQ1E;;;;GAIG;AACH,qBAAa,4BAA4B;IAIjC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJ9B,OAAO,CAAC,SAAS,CAAY;gBAGR,QAAQ,EAAE,4BAA4B,EACtC,SAAS,EAAE,iBAAiB;IAcjD,oBAAoB;IAUpB,eAAe,CAAC,KAAK,EAAE,MAAM;IAkB7B,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAexB,cAAc,CAAC,KAAK,EAAE,mBAAmB;IAUzC,eAAe,CAAC,KAAK,EAAE,mBAAmB;IAUhD,iBAAiB;IAmFX,aAAa,CAAC,KAAK,EAAE,mBAAmB;CAwCjD"}
|