homebridge-plugin-klares4 2.1.3 → 2.1.4-rc.2
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 +20 -0
- package/README.md +100 -6
- package/dist/platform/matter-device-mapper.d.ts.map +1 -1
- package/dist/platform/matter-device-mapper.js +7 -2
- package/dist/platform/matter-device-mapper.js.map +1 -1
- package/dist/platform/matter-name-sanitizer.d.ts +41 -18
- package/dist/platform/matter-name-sanitizer.d.ts.map +1 -1
- package/dist/platform/matter-name-sanitizer.js +126 -46
- package/dist/platform/matter-name-sanitizer.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.1.4-rc.2] - 2026-05-24
|
|
11
|
+
|
|
12
|
+
### Changed — Matter accessory name sanitisation (allowlist + typed collision suffix)
|
|
13
|
+
|
|
14
|
+
- **Sanitiser switched from blocklist to HomeKit-safe allowlist.** Output is now guaranteed to satisfy the HAP-NodeJS `checkName` rule (`^[\p{L}\p{N}][\p{L}\p{N}’ '.,-]*[\p{L}\p{N}’]$`) which is the strictest of the three controllers (Apple Home, Alexa, Google Home). Characters outside the set become spaces; leading/trailing punctuation is trimmed so the result always starts with a letter/digit and ends with a letter/digit/`’`. New regression test in `test/matter-name-sanitizer.test.js` runs the HAP regex against a sample of sanitised outputs.
|
|
15
|
+
- **Apostrophes preserved.** Both `'` and `’` are valid HomeKit characters and are now kept. Previously `Comando dell'Ingresso` was rewritten to `Comando dellIngresso`; it now stays `Comando dell'Ingresso`.
|
|
16
|
+
- **Collision suffix is now a human-readable Italian type tag.** When two accessories sanitise to the same string the first registered keeps the clean name; the second receives ` - <Tipo>` where `<Tipo>` is derived from the Lares4 device type: `Sensore` (zone, env. sensor), `Tapparella` (cover), `Luce` (light), `Termostato` (thermostat), `Scenario`, `Cancello` (gate). Example from a real install: previously `Finestra Cucina` (cover) + `Finestra Cucina` (zone) became `Finestra Cucina` + `Finestra Cucina er_1`; now they become `Finestra Cucina` + `Finestra Cucina - Sensore`.
|
|
17
|
+
- **Anti-redundancy guard.** If the sanitised name already mentions the device's own type as a whole word (e.g. two covers both called `Tapparella Studio`), the typed suffix is skipped and the legacy uuid-derived 4-char fallback is used to avoid `Tapparella Studio - Tapparella`. The fallback is also used when the device type is unknown or when even the typed candidate collides.
|
|
18
|
+
- **API change (internal).** `MatterNameRegistry.resolve(uuid, sanitized, deviceType?)` now accepts an optional third argument. Callers that omit it (legacy / test convenience) get the uuid-derived fallback on collision, preserving the previous 2.1.3 behaviour.
|
|
19
|
+
|
|
20
|
+
### User-visible impact
|
|
21
|
+
|
|
22
|
+
Accessory `displayName`s visible in Apple Home, Alexa and Google Home will change for installations that previously hit collisions (e.g. cover + zone sharing the same Lares4 label). Custom names set by the user inside Apple Home / Alexa are preserved by those controllers and are not affected. UUIDs are unchanged, so HomeKit rooms and automations survive.
|
|
23
|
+
|
|
24
|
+
## [2.1.4-rc.1] - 2026-05-24
|
|
25
|
+
|
|
26
|
+
### Fixed — Matter scenarios visible on Alexa (and re-tappable on Apple Home)
|
|
27
|
+
|
|
28
|
+
- **Scenarios were invisible in the Alexa app and stuck "ON" forever in Apple Home.** The momentary-switch mapper (used for `scenario` and `gate` devices) registered them with Matter device type `OnOffSwitch` (0x0103). Per Matter spec, `OnOffSwitch` is a **client** device — a wall switch that emits commands via binding, not a controllable endpoint. Apple Home is permissive and exposed it anyway, but Alexa follows the spec strictly and silently drops it from the device list. Combined with the existing momentary-trigger semantics (no real "off"), the result was: invisibility on Alexa, and on Apple Home the cluster `onOff` value latched to `true` so a second tap was suppressed by the controller before reaching the panel. Fix in [`src/platform/matter-device-mapper.ts`](src/platform/matter-device-mapper.ts): `mapMomentarySwitch` now uses `deviceTypes.OnOffOutlet` (Matter `OnOffPlugInUnit`, 0x010A) — a controllable server device that every ecosystem (Apple Home, Alexa, Google Home, SmartThings) imports as a tappable plug. The auto-off path (`scheduleMomentaryAutoOff`, default 500 ms, configurable via `scenarioAutoOffDelay`) continues to reset the cluster state so subsequent taps re-trigger the scenario. Visual effect: in Apple Home the scenario icon changes from "switch" to "outlet"; in Alexa scenarios now appear under **Plugs** and respond to voice commands ("Alexa, accendi Mood Cena"). Regression coverage: new test file [`test/matter-device-mapper.test.js`](test/matter-device-mapper.test.js) asserts the device type, the auto-off scheduling and that an auto-off rejection (e.g. endpoint not yet ready) is swallowed without surfacing to the controller.
|
|
29
|
+
|
|
10
30
|
## [2.1.3] - 2026-05-23
|
|
11
31
|
|
|
12
32
|
Stable release of the **`2.1.3-rc.1` … `2.1.3-rc.7`** cycle, validated on a
|
package/README.md
CHANGED
|
@@ -1,17 +1,69 @@
|
|
|
1
1
|
# homebridge-plugin-klares4
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Bring your Ksenia Lares4 alarm system into Apple HomeKit — and Matter** — security zones, lights, covers, thermostats and environmental sensors, all from a single Homebridge plugin. Local-only via WebSocket, no cloud required. Full **Matter** support via Homebridge 2.x: the same accessories are exposed to Google Home, Amazon Alexa and SmartThings.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/homebridge-plugin-klares4)
|
|
6
|
+
[](https://www.npmjs.com/package/homebridge-plugin-klares4)
|
|
4
7
|
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
8
|
+
[](https://nodejs.org)
|
|
5
9
|
[](https://opensource.org/licenses/MIT)
|
|
10
|
+
[](https://github.com/paolo-trivi/homebridge-plugin-klares4/stargazers)
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
*Zones, lights, covers, thermostats and Ksenia scenarios appear as native HomeKit accessories, grouped by room.*
|
|
15
|
+
|
|
16
|
+

|
|
6
17
|
|
|
7
|
-
|
|
18
|
+
*Environmental sensors and climate controls integrate into the Home app's category views (Climate, Security, Lights).*
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Why this plugin?
|
|
23
|
+
|
|
24
|
+
| | **homebridge-plugin-klares4** | Home Assistant + HomeKit Bridge | Ksenia ergo / Lares 4.0 app | None (no HomeKit) |
|
|
25
|
+
|---|---|---|---|---|
|
|
26
|
+
| Native HomeKit (Siri, scenes, automations) | ✅ | ✅ (via HA bridge) | ❌ | ❌ |
|
|
27
|
+
| **Matter** (Google Home, Alexa, SmartThings) | ✅ via Homebridge 2.x | ✅ via HA Matter Server | ❌ | ❌ |
|
|
28
|
+
| Works **fully local** (no cloud) | ✅ | ✅ | depends | n/a |
|
|
29
|
+
| Setup effort | Install + IP/PIN | Full HA stack required | Already installed | n/a |
|
|
30
|
+
| Zones, lights, covers, thermostats, env. sensors | ✅ all in one | ✅ (community/HACS, if any) | ✅ (Ksenia UI only) | n/a |
|
|
31
|
+
| Thermostat handling tuned for Matter (echo guard, endpoint recovery) | ✅ | partial | n/a | n/a |
|
|
32
|
+
| MQTT bridge built-in | ✅ optional | via HA | ❌ | n/a |
|
|
33
|
+
| Real-time updates (WebSocket) | ✅ | ✅ | ✅ | n/a |
|
|
34
|
+
| `.ksa` backup import for routing & room mapping | ✅ | ❌ | n/a | n/a |
|
|
35
|
+
| Maintained, in active development | ✅ | community | vendor | n/a |
|
|
36
|
+
| Open source | ✅ MIT | ✅ | ❌ | n/a |
|
|
37
|
+
|
|
38
|
+
If you already run Home Assistant, both options are valid; this plugin is the simplest path if your hub is already Homebridge.
|
|
39
|
+
|
|
40
|
+
## Matter support
|
|
41
|
+
|
|
42
|
+
Running on **Homebridge 2.x**, every Lares4 accessory exposed by this plugin is automatically reachable via Matter — meaning the same lights, covers, thermostats and sensors that show up in the Apple Home app also work in **Google Home**, **Amazon Alexa** and **Samsung SmartThings**, all over your local network.
|
|
43
|
+
|
|
44
|
+
The plugin includes Matter-specific reliability code that has been tested in real installations:
|
|
45
|
+
|
|
46
|
+
- **Thermostat echo guard** — suppresses spurious round-trip updates from Matter controllers, so target temperatures and modes don't flicker.
|
|
47
|
+
- **Stale endpoint recovery** — when a Matter endpoint becomes stale after a controller restart, the plugin detects and rebuilds it instead of leaving a ghost accessory.
|
|
48
|
+
- **Mode and temperature mapping** tailored for Matter clusters (heat/cool/auto, setpoint ranges) so commands from any ecosystem reach the panel correctly.
|
|
49
|
+
|
|
50
|
+
No extra configuration is required: enable Matter in Homebridge and pair the bridge with your preferred ecosystem.
|
|
51
|
+
|
|
52
|
+
## Compatibility
|
|
53
|
+
|
|
54
|
+
Tested with **Ksenia Lares 4.0** central units (firmware exposing the `KS_WSOCK` WebSocket subprotocol on the panel's local IP, with a valid system PIN). If your specific Lares 4.0 model works or has issues, please open an issue so the compatibility list can grow.
|
|
55
|
+
|
|
56
|
+
Requires Homebridge `>= 1.6.0` (also compatible with the 2.x beta line) and Node.js `>= 20`. **Matter support requires Homebridge 2.x.**
|
|
8
57
|
|
|
9
58
|
---
|
|
10
59
|
|
|
11
60
|
## Full Documentation
|
|
12
61
|
|
|
13
|
-
- English docs: `docs/en/`
|
|
14
|
-
- Documentazione italiana: `docs/it/`
|
|
62
|
+
- English docs: [`docs/en/`](docs/en/)
|
|
63
|
+
- Documentazione italiana: [`docs/it/`](docs/it/)
|
|
64
|
+
- Internal architecture: [`ARCHITECTURE.md`](ARCHITECTURE.md)
|
|
65
|
+
|
|
66
|
+
If this plugin saves you time, please ⭐ the repo — it really helps others discover it.
|
|
15
67
|
|
|
16
68
|
---
|
|
17
69
|
|
|
@@ -27,6 +79,7 @@ Complete plugin for Ksenia Lares4 systems integrating security zones, lights, co
|
|
|
27
79
|
- **System Temperature Sensors**: Internal and external temperature from central unit
|
|
28
80
|
- **Real-time Updates**: WebSocket connection with automatic reconnection
|
|
29
81
|
- **Command ACK & Timeout**: Write commands wait for API response with configurable timeout
|
|
82
|
+
- **Matter Support**: Automatic Matter exposure via Homebridge 2.x (Google Home, Alexa, SmartThings)
|
|
30
83
|
- **UI Configuration**: Complete graphical interface in Homebridge UI
|
|
31
84
|
- **Customization**: Custom names and selective entity exclusion
|
|
32
85
|
- **MQTT Bridge**: State publishing and command reception via MQTT (optional)
|
|
@@ -34,7 +87,7 @@ Complete plugin for Ksenia Lares4 systems integrating security zones, lights, co
|
|
|
34
87
|
|
|
35
88
|
### Prerequisites
|
|
36
89
|
|
|
37
|
-
- Homebridge >= 1.6.0
|
|
90
|
+
- Homebridge >= 1.6.0 (Homebridge 2.x required for Matter)
|
|
38
91
|
- Node.js >= 20.0.0
|
|
39
92
|
- Ksenia Lares4 system with WebSocket access enabled
|
|
40
93
|
|
|
@@ -334,6 +387,46 @@ This project is released under the MIT license.
|
|
|
334
387
|
|
|
335
388
|
## Documentazione Italiana
|
|
336
389
|
|
|
390
|
+
**Porta il tuo sistema d'allarme Ksenia Lares4 dentro Apple HomeKit — e Matter** — zone di sicurezza, luci, tapparelle, termostati e sensori ambientali, tutto da un unico plugin Homebridge. Solo locale via WebSocket, nessun cloud richiesto. Supporto **Matter** completo tramite Homebridge 2.x: gli stessi accessori vengono esposti a Google Home, Amazon Alexa e SmartThings.
|
|
391
|
+
|
|
392
|
+
### Perche questo plugin?
|
|
393
|
+
|
|
394
|
+
| | **homebridge-plugin-klares4** | Home Assistant + Bridge HomeKit | App Ksenia ergo / Lares 4.0 | Nessuna integrazione |
|
|
395
|
+
|---|---|---|---|---|
|
|
396
|
+
| HomeKit nativo (Siri, scene, automazioni) | ✅ | ✅ (via bridge HA) | ❌ | ❌ |
|
|
397
|
+
| **Matter** (Google Home, Alexa, SmartThings) | ✅ via Homebridge 2.x | ✅ via HA Matter Server | ❌ | ❌ |
|
|
398
|
+
| Funziona **solo locale** (no cloud) | ✅ | ✅ | dipende | n/a |
|
|
399
|
+
| Sforzo di setup | Install + IP/PIN | Stack HA completo richiesto | Gia installata | n/a |
|
|
400
|
+
| Zone, luci, tapparelle, termostati, sensori | ✅ tutto in uno | ✅ (community/HACS, se esiste) | ✅ (solo UI Ksenia) | n/a |
|
|
401
|
+
| Gestione termostati ottimizzata per Matter (echo guard, recovery endpoint) | ✅ | parziale | n/a | n/a |
|
|
402
|
+
| Bridge MQTT integrato | ✅ opzionale | tramite HA | ❌ | n/a |
|
|
403
|
+
| Aggiornamenti real-time (WebSocket) | ✅ | ✅ | ✅ | n/a |
|
|
404
|
+
| Import backup `.ksa` per routing e mappatura stanze | ✅ | ❌ | n/a | n/a |
|
|
405
|
+
| Mantenuto, in sviluppo attivo | ✅ | community | vendor | n/a |
|
|
406
|
+
| Open source | ✅ MIT | ✅ | ❌ | n/a |
|
|
407
|
+
|
|
408
|
+
Se usi gia Home Assistant, entrambe le opzioni sono valide; questo plugin e la strada piu semplice se il tuo hub e gia Homebridge.
|
|
409
|
+
|
|
410
|
+
### Supporto Matter
|
|
411
|
+
|
|
412
|
+
Con **Homebridge 2.x**, ogni accessorio Lares4 esposto da questo plugin e automaticamente raggiungibile via Matter — le stesse luci, tapparelle, termostati e sensori che compaiono nell'app Casa funzionano anche in **Google Home**, **Amazon Alexa** e **Samsung SmartThings**, tutto sulla rete locale.
|
|
413
|
+
|
|
414
|
+
Il plugin include codice di affidabilita specifico per Matter, testato in installazioni reali:
|
|
415
|
+
|
|
416
|
+
- **Echo guard sui termostati** — sopprime gli aggiornamenti spuri di ritorno dai controller Matter, evitando che temperature impostate e modalita "ballino".
|
|
417
|
+
- **Recovery degli endpoint stale** — quando un endpoint Matter diventa stale dopo il riavvio di un controller, il plugin lo rileva e lo ricostruisce invece di lasciare un accessorio fantasma.
|
|
418
|
+
- **Mapping modalita/temperature** pensato per i cluster Matter (heat/cool/auto, range setpoint) cosi i comandi da qualsiasi ecosistema arrivano correttamente alla centrale.
|
|
419
|
+
|
|
420
|
+
Non serve nessuna configurazione aggiuntiva: abilita Matter in Homebridge e abbina il bridge all'ecosistema preferito.
|
|
421
|
+
|
|
422
|
+
### Compatibilita
|
|
423
|
+
|
|
424
|
+
Testato con centrali **Ksenia Lares 4.0** (firmware che espone il sottoprotocollo WebSocket `KS_WSOCK` sull'IP locale del pannello, con PIN di sistema valido). Se il tuo modello specifico Lares 4.0 funziona o ha problemi, apri una issue cosi possiamo ampliare la lista di compatibilita.
|
|
425
|
+
|
|
426
|
+
Richiede Homebridge `>= 1.6.0` (compatibile anche con la linea 2.x beta) e Node.js `>= 20`. **Il supporto Matter richiede Homebridge 2.x.**
|
|
427
|
+
|
|
428
|
+
Se questo plugin ti fa risparmiare tempo, lascia una ⭐ al repo — aiuta davvero altri a trovarlo.
|
|
429
|
+
|
|
337
430
|
### Caratteristiche
|
|
338
431
|
|
|
339
432
|
- **Zone di Sicurezza**: Sensori di contatto per porte e finestre
|
|
@@ -343,13 +436,14 @@ This project is released under the MIT license.
|
|
|
343
436
|
- **Sensori Ambientali**: Temperatura, umidita e luminosita in tempo reale
|
|
344
437
|
- **Sensori Temperatura Sistema**: Temperatura interna ed esterna dalla centrale
|
|
345
438
|
- **Aggiornamenti Real-time**: Connessione WebSocket con riconnessione automatica
|
|
439
|
+
- **Supporto Matter**: Esposizione automatica via Matter su Homebridge 2.x (Google Home, Alexa, SmartThings)
|
|
346
440
|
- **Configurazione UI**: Interfaccia grafica completa in Homebridge UI
|
|
347
441
|
- **Personalizzazione**: Nomi personalizzati ed esclusione selettiva di entita
|
|
348
442
|
- **Bridge MQTT**: Pubblicazione stati e ricezione comandi via MQTT (opzionale)
|
|
349
443
|
|
|
350
444
|
### Prerequisiti
|
|
351
445
|
|
|
352
|
-
- Homebridge >= 1.6.0
|
|
446
|
+
- Homebridge >= 1.6.0 (Homebridge 2.x richiesto per Matter)
|
|
353
447
|
- Node.js >= 20.0.0
|
|
354
448
|
- Sistema Ksenia Lares4 con accesso WebSocket abilitato
|
|
355
449
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matter-device-mapper.d.ts","sourceRoot":"","sources":["../../src/platform/matter-device-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAA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KZ,gBAAgB,EAEnB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACH,0BAA0B,EAAE,0BAA0B,EAEzD,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAM/E,OAAO,EAAE,0BAA0B,IAAI,cAAc,EAAE,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAGD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAOrF;AAID,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,UAAU,UAAU;IAChB,GAAG,EAAE,GAAG,CAAC;IACT,GAAG,EAAE,OAAO,YAAY,EAAE,MAAM,CAAC;IACjC,WAAW,EAAE,MAAM,qBAAqB,GAAG,SAAS,CAAC;IACrD,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,2BAA2B,CAAC;CACvD;AA4HD;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,GAAG,eAAe,CAO5G;AA6CD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,CAmB3G"}
|
|
@@ -43,7 +43,7 @@ function scheduleMomentaryAutoOff(uuid, deps) {
|
|
|
43
43
|
}, delay);
|
|
44
44
|
}
|
|
45
45
|
function baseFields(device, log) {
|
|
46
|
-
const sanitized = matterNameRegistry.resolve(device.id, (0, matter_name_sanitizer_1.sanitizeMatterAccessoryName)(device.name, device.id));
|
|
46
|
+
const sanitized = matterNameRegistry.resolve(device.id, (0, matter_name_sanitizer_1.sanitizeMatterAccessoryName)(device.name, device.id), device.type);
|
|
47
47
|
if (log && sanitized !== device.name)
|
|
48
48
|
log.debug(`[Matter] Accessory name sanitized: "${device.name}" -> "${sanitized}"`);
|
|
49
49
|
return {
|
|
@@ -169,9 +169,14 @@ function mapZone(device, deps) {
|
|
|
169
169
|
return { ...baseFields(device, deps.log), deviceType: deps.api.matter.deviceTypes.ContactSensor, clusters: { booleanState: { stateValue: !device.status.open } } };
|
|
170
170
|
}
|
|
171
171
|
function mapMomentarySwitch(device, trigger, deps) {
|
|
172
|
+
// OnOffOutlet (= Matter OnOffPlugInUnit, 0x010A) instead of OnOffSwitch (0x0103).
|
|
173
|
+
// OnOffSwitch is a Matter *client* device (a wall switch sending commands via binding) —
|
|
174
|
+
// Alexa follows the spec and refuses to import it as a controllable accessory, leaving
|
|
175
|
+
// scenarios invisible. OnOffOutlet is a controllable server device that every ecosystem
|
|
176
|
+
// (Apple Home, Alexa, Google) exposes as a tappable plug.
|
|
172
177
|
return {
|
|
173
178
|
...baseFields(device, deps.log),
|
|
174
|
-
deviceType: deps.api.matter.deviceTypes.
|
|
179
|
+
deviceType: deps.api.matter.deviceTypes.OnOffOutlet,
|
|
175
180
|
clusters: { onOff: { onOff: false } },
|
|
176
181
|
handlers: { onOff: {
|
|
177
182
|
on: async () => { await trigger(); scheduleMomentaryAutoOff(device.id, deps); },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matter-device-mapper.js","sourceRoot":"","sources":["../../src/platform/matter-device-mapper.ts"],"names":[],"mappings":";;;AA2BA,8CAEC;AAGD,wDAOC;AAID,wDAGC;AA+ID,4EAOC;
|
|
1
|
+
{"version":3,"file":"matter-device-mapper.js","sourceRoot":"","sources":["../../src/platform/matter-device-mapper.ts"],"names":[],"mappings":";;;AA2BA,8CAEC;AAGD,wDAOC;AAID,wDAGC;AA+ID,4EAOC;AA6CD,0DAmBC;AAx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;YAChD,KAAK,UAAU,CAAC,CAAG,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACpD,KAAK,MAAM,CAAC,CAAO,OAAO,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAChD,OAAO,CAAC,CAAW,OAAO,SAAS,CAAC;QACxC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA8B,MAAuB,CAAC,IAAI,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjI,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC"}
|
|
@@ -4,35 +4,58 @@
|
|
|
4
4
|
* Normalises display names for Matter / Homebridge 2 controllers without
|
|
5
5
|
* touching HAP names, UUIDs, or the original klares4 device names.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* The output is an *intersection* of three constraints:
|
|
8
|
+
*
|
|
9
|
+
* - Matter spec §1.7.7.1 — nodeLabel/Basic.nodeLabel: UTF-8 string, max 32 chars.
|
|
10
|
+
* - HAP-NodeJS `checkName` rule (Apple HomeKit naming guidance):
|
|
11
|
+
* ^[\p{L}\p{N}][\p{L}\p{N}’ '.,-]*[\p{L}\p{N}’]$
|
|
12
|
+
* - Empirical Alexa/Google tolerance — both controllers happily accept the
|
|
13
|
+
* HomeKit-safe subset, so targeting HomeKit is also the safest target
|
|
14
|
+
* for the wider Matter ecosystem.
|
|
15
|
+
*
|
|
16
|
+
* Allowlist (single source of truth, kept in sync with HAP `checkName`):
|
|
17
|
+
* \p{L} Unicode letters (includes Italian accents à è é ì ò ù)
|
|
18
|
+
* \p{N} Unicode digits
|
|
19
|
+
* space
|
|
20
|
+
* ' ASCII apostrophe
|
|
21
|
+
* ’ Right single quotation mark (typographic apostrophe)
|
|
22
|
+
* . period
|
|
23
|
+
* , comma
|
|
24
|
+
* - hyphen-minus
|
|
25
|
+
*
|
|
26
|
+
* Anything outside this set is replaced with a single space (then collapsed).
|
|
8
27
|
*/
|
|
9
28
|
/**
|
|
10
29
|
* Sanitise a device name for use as a Matter accessory `displayName`.
|
|
11
30
|
*
|
|
12
|
-
*
|
|
13
|
-
* 1. Replace `+` with ` e
|
|
14
|
-
* 2.
|
|
15
|
-
* 3.
|
|
16
|
-
* 4.
|
|
17
|
-
* 5.
|
|
18
|
-
* 6.
|
|
19
|
-
* 7.
|
|
20
|
-
*
|
|
31
|
+
* Pipeline:
|
|
32
|
+
* 1. Replace `+` with ` e ` (human-readable expansion of "Inserisci A+B").
|
|
33
|
+
* 2. Strip parentheses/brackets but keep their content.
|
|
34
|
+
* 3. Replace every char outside the allowlist with a space.
|
|
35
|
+
* 4. Collapse whitespace, trim.
|
|
36
|
+
* 5. Trim non-allowed boundary chars (so first/last char satisfies HAP rule).
|
|
37
|
+
* 6. Truncate to MAX_NAME_LENGTH, retrim boundary on the right.
|
|
38
|
+
* 7. Empty result → `fallback` (default 'Device'), itself run through the
|
|
39
|
+
* same boundary trim to guarantee HomeKit compliance.
|
|
21
40
|
*/
|
|
22
41
|
export declare function sanitizeMatterAccessoryName(name: string, fallback?: string): string;
|
|
23
42
|
/**
|
|
24
|
-
* Tracks sanitised names per registry instance so that two devices whose
|
|
25
|
-
* normalise to the same string receive distinct suffixes
|
|
26
|
-
*
|
|
27
|
-
* Instantiate once per plugin boot (module-level in matter-device-mapper).
|
|
28
|
-
* For tests, instantiate a fresh registry per test to avoid cross-test pollution.
|
|
43
|
+
* Tracks sanitised names per registry instance so that two devices whose
|
|
44
|
+
* names normalise to the same string receive distinct, human-readable suffixes
|
|
45
|
+
* based on their Lares4 device type.
|
|
29
46
|
*/
|
|
30
47
|
export declare class MatterNameRegistry {
|
|
31
48
|
private readonly nameToUuid;
|
|
32
49
|
/**
|
|
33
|
-
* Return `sanitized` if it has not been used yet (or was used by the same
|
|
34
|
-
* Otherwise append a
|
|
50
|
+
* Return `sanitized` if it has not been used yet (or was used by the same
|
|
51
|
+
* uuid). Otherwise append a typed suffix (' - Sensore', ' - Tapparella',
|
|
52
|
+
* ...). If the typed suffix is unavailable or already taken, fall back to
|
|
53
|
+
* the legacy uuid-derived 4-char suffix.
|
|
54
|
+
*
|
|
55
|
+
* `deviceType` is the Lares4 device.type (zone, cover, light, ...). It is
|
|
56
|
+
* optional for backward compatibility with callers that pre-date the typed
|
|
57
|
+
* suffix; in that case the uuid fallback is used immediately on collision.
|
|
35
58
|
*/
|
|
36
|
-
resolve(uuid: string, sanitized: string): string;
|
|
59
|
+
resolve(uuid: string, sanitized: string, deviceType?: string): string;
|
|
37
60
|
}
|
|
38
61
|
//# sourceMappingURL=matter-name-sanitizer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matter-name-sanitizer.d.ts","sourceRoot":"","sources":["../../src/platform/matter-name-sanitizer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"matter-name-sanitizer.d.ts","sourceRoot":"","sources":["../../src/platform/matter-name-sanitizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAUH;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAW,GAAG,MAAM,CAIrF;AAyED;;;;GAIG;AACH,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IAExD;;;;;;;;;OASG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;CAoBxE"}
|
|
@@ -5,80 +5,160 @@
|
|
|
5
5
|
* Normalises display names for Matter / Homebridge 2 controllers without
|
|
6
6
|
* touching HAP names, UUIDs, or the original klares4 device names.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* The output is an *intersection* of three constraints:
|
|
9
|
+
*
|
|
10
|
+
* - Matter spec §1.7.7.1 — nodeLabel/Basic.nodeLabel: UTF-8 string, max 32 chars.
|
|
11
|
+
* - HAP-NodeJS `checkName` rule (Apple HomeKit naming guidance):
|
|
12
|
+
* ^[\p{L}\p{N}][\p{L}\p{N}’ '.,-]*[\p{L}\p{N}’]$
|
|
13
|
+
* - Empirical Alexa/Google tolerance — both controllers happily accept the
|
|
14
|
+
* HomeKit-safe subset, so targeting HomeKit is also the safest target
|
|
15
|
+
* for the wider Matter ecosystem.
|
|
16
|
+
*
|
|
17
|
+
* Allowlist (single source of truth, kept in sync with HAP `checkName`):
|
|
18
|
+
* \p{L} Unicode letters (includes Italian accents à è é ì ò ù)
|
|
19
|
+
* \p{N} Unicode digits
|
|
20
|
+
* space
|
|
21
|
+
* ' ASCII apostrophe
|
|
22
|
+
* ’ Right single quotation mark (typographic apostrophe)
|
|
23
|
+
* . period
|
|
24
|
+
* , comma
|
|
25
|
+
* - hyphen-minus
|
|
26
|
+
*
|
|
27
|
+
* Anything outside this set is replaced with a single space (then collapsed).
|
|
9
28
|
*/
|
|
10
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
30
|
exports.MatterNameRegistry = void 0;
|
|
12
31
|
exports.sanitizeMatterAccessoryName = sanitizeMatterAccessoryName;
|
|
13
|
-
/**
|
|
14
|
-
* Matter spec §1.7.7.1 (BridgedDeviceBasicInformation.nodeLabel and Basic.nodeLabel)
|
|
15
|
-
* caps node-label / display-name strings at 32 characters. The Homebridge 2 Matter
|
|
16
|
-
* bundle validates this constraint at register time and refuses the accessory if
|
|
17
|
-
* exceeded — see real-world failure on scenario_12 / "Inserisci Tapparelle+Volumetrici"
|
|
18
|
-
* (32 chars → " e " expansion → 34 chars → register rejected).
|
|
19
|
-
*
|
|
20
|
-
* Keep this constant authoritative: any name surfaced to Matter as displayName or
|
|
21
|
-
* nodeLabel MUST be sanitised through this module.
|
|
22
|
-
*/
|
|
23
32
|
const MAX_NAME_LENGTH = 32;
|
|
33
|
+
const ALLOWED_MID_CHARS = /[^\p{L}\p{N}’ '.,-]/gu;
|
|
34
|
+
// Per HomeKit rule the name MUST start with letter/digit and end with letter/digit/’.
|
|
35
|
+
const BOUNDARY_LEFT = /^[^\p{L}\p{N}]+/u;
|
|
36
|
+
const BOUNDARY_RIGHT = /[^\p{L}\p{N}’]+$/u;
|
|
24
37
|
/**
|
|
25
38
|
* Sanitise a device name for use as a Matter accessory `displayName`.
|
|
26
39
|
*
|
|
27
|
-
*
|
|
28
|
-
* 1. Replace `+` with ` e
|
|
29
|
-
* 2.
|
|
30
|
-
* 3.
|
|
31
|
-
* 4.
|
|
32
|
-
* 5.
|
|
33
|
-
* 6.
|
|
34
|
-
* 7.
|
|
35
|
-
*
|
|
40
|
+
* Pipeline:
|
|
41
|
+
* 1. Replace `+` with ` e ` (human-readable expansion of "Inserisci A+B").
|
|
42
|
+
* 2. Strip parentheses/brackets but keep their content.
|
|
43
|
+
* 3. Replace every char outside the allowlist with a space.
|
|
44
|
+
* 4. Collapse whitespace, trim.
|
|
45
|
+
* 5. Trim non-allowed boundary chars (so first/last char satisfies HAP rule).
|
|
46
|
+
* 6. Truncate to MAX_NAME_LENGTH, retrim boundary on the right.
|
|
47
|
+
* 7. Empty result → `fallback` (default 'Device'), itself run through the
|
|
48
|
+
* same boundary trim to guarantee HomeKit compliance.
|
|
36
49
|
*/
|
|
37
50
|
function sanitizeMatterAccessoryName(name, fallback = 'Device') {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
const safe = clean(typeof name === 'string' ? name : '');
|
|
52
|
+
if (safe)
|
|
53
|
+
return safe;
|
|
54
|
+
return clean(fallback) || 'Device';
|
|
55
|
+
}
|
|
56
|
+
function clean(raw) {
|
|
57
|
+
let s = raw;
|
|
41
58
|
s = s.replace(/\+/g, ' e ');
|
|
42
59
|
s = s.replace(/[()[\]]/g, ' ');
|
|
43
|
-
|
|
44
|
-
s = s.replace(
|
|
45
|
-
|
|
46
|
-
s = s.replace(/[/\\|<>{}*?!@#$%^&=~`]/g, ' ');
|
|
47
|
-
s = s.replace(/\s+/g, ' ');
|
|
48
|
-
s = s.trim();
|
|
60
|
+
s = s.replace(ALLOWED_MID_CHARS, ' ');
|
|
61
|
+
s = s.replace(/\s+/g, ' ').trim();
|
|
62
|
+
s = s.replace(BOUNDARY_LEFT, '').replace(BOUNDARY_RIGHT, '');
|
|
49
63
|
if (s.length > MAX_NAME_LENGTH) {
|
|
50
|
-
s = s.slice(0, MAX_NAME_LENGTH).
|
|
64
|
+
s = s.slice(0, MAX_NAME_LENGTH).replace(BOUNDARY_RIGHT, '');
|
|
51
65
|
}
|
|
52
|
-
return s
|
|
66
|
+
return s;
|
|
53
67
|
}
|
|
54
68
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
* Italian, HomeKit-safe collision suffix per Lares4 device type.
|
|
70
|
+
* Every value uses only characters from the allowlist above.
|
|
71
|
+
*/
|
|
72
|
+
const TYPE_SUFFIX = {
|
|
73
|
+
zone: 'Sensore',
|
|
74
|
+
sensor: 'Sensore',
|
|
75
|
+
cover: 'Tapparella',
|
|
76
|
+
light: 'Luce',
|
|
77
|
+
thermostat: 'Termostato',
|
|
78
|
+
scenario: 'Scenario',
|
|
79
|
+
gate: 'Cancello',
|
|
80
|
+
};
|
|
81
|
+
const SUFFIX_SEPARATOR = ' - ';
|
|
82
|
+
/**
|
|
83
|
+
* Does `name` already mention `suffix` as a whole word?
|
|
84
|
+
* Used to skip redundant collision tags like "Tapparella Studio - Tapparella".
|
|
85
|
+
*/
|
|
86
|
+
function nameAlreadyMentions(name, suffix) {
|
|
87
|
+
const pattern = new RegExp(`(^|\\s)${suffix}(\\s|$)`, 'iu');
|
|
88
|
+
return pattern.test(name);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Build a typed-suffix candidate, honouring the 32-char cap by truncating the
|
|
92
|
+
* *name* part, never the suffix. Returns the candidate or `null` if the type
|
|
93
|
+
* suffix is unknown or the original name already mentions the type.
|
|
94
|
+
*/
|
|
95
|
+
function buildTypedSuffix(name, deviceType) {
|
|
96
|
+
if (!deviceType)
|
|
97
|
+
return null;
|
|
98
|
+
const suffix = TYPE_SUFFIX[deviceType];
|
|
99
|
+
if (!suffix)
|
|
100
|
+
return null;
|
|
101
|
+
if (nameAlreadyMentions(name, suffix))
|
|
102
|
+
return null;
|
|
103
|
+
const tail = `${SUFFIX_SEPARATOR}${suffix}`;
|
|
104
|
+
const maxNameLen = MAX_NAME_LENGTH - tail.length;
|
|
105
|
+
if (maxNameLen <= 0)
|
|
106
|
+
return null;
|
|
107
|
+
const head = name.length <= maxNameLen ? name : name.slice(0, maxNameLen).replace(BOUNDARY_RIGHT, '');
|
|
108
|
+
if (!head)
|
|
109
|
+
return null;
|
|
110
|
+
return `${head}${tail}`;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Last-resort suffix when the typed suffix is unavailable or also collides.
|
|
114
|
+
* Uses the last 4 hex-like chars of the uuid — same shape as before for
|
|
115
|
+
* backward compatibility with installations that may already display this.
|
|
116
|
+
*/
|
|
117
|
+
function buildUuidFallbackSuffix(name, uuid) {
|
|
118
|
+
const tag = uuid.replace(/-/g, '').slice(-4);
|
|
119
|
+
const tail = `${SUFFIX_SEPARATOR}${tag}`;
|
|
120
|
+
const maxNameLen = MAX_NAME_LENGTH - tail.length;
|
|
121
|
+
if (maxNameLen <= 0)
|
|
122
|
+
return name.slice(0, MAX_NAME_LENGTH).replace(BOUNDARY_RIGHT, '');
|
|
123
|
+
const head = name.length <= maxNameLen ? name : name.slice(0, maxNameLen).replace(BOUNDARY_RIGHT, '');
|
|
124
|
+
return `${head}${tail}`;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Tracks sanitised names per registry instance so that two devices whose
|
|
128
|
+
* names normalise to the same string receive distinct, human-readable suffixes
|
|
129
|
+
* based on their Lares4 device type.
|
|
60
130
|
*/
|
|
61
131
|
class MatterNameRegistry {
|
|
62
132
|
constructor() {
|
|
63
133
|
this.nameToUuid = new Map();
|
|
64
134
|
}
|
|
65
135
|
/**
|
|
66
|
-
* Return `sanitized` if it has not been used yet (or was used by the same
|
|
67
|
-
* Otherwise append a
|
|
136
|
+
* Return `sanitized` if it has not been used yet (or was used by the same
|
|
137
|
+
* uuid). Otherwise append a typed suffix (' - Sensore', ' - Tapparella',
|
|
138
|
+
* ...). If the typed suffix is unavailable or already taken, fall back to
|
|
139
|
+
* the legacy uuid-derived 4-char suffix.
|
|
140
|
+
*
|
|
141
|
+
* `deviceType` is the Lares4 device.type (zone, cover, light, ...). It is
|
|
142
|
+
* optional for backward compatibility with callers that pre-date the typed
|
|
143
|
+
* suffix; in that case the uuid fallback is used immediately on collision.
|
|
68
144
|
*/
|
|
69
|
-
resolve(uuid, sanitized) {
|
|
145
|
+
resolve(uuid, sanitized, deviceType) {
|
|
70
146
|
const existing = this.nameToUuid.get(sanitized);
|
|
71
147
|
if (!existing || existing === uuid) {
|
|
72
148
|
this.nameToUuid.set(sanitized, uuid);
|
|
73
149
|
return sanitized;
|
|
74
150
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
151
|
+
const typed = buildTypedSuffix(sanitized, deviceType);
|
|
152
|
+
if (typed) {
|
|
153
|
+
const typedExisting = this.nameToUuid.get(typed);
|
|
154
|
+
if (!typedExisting || typedExisting === uuid) {
|
|
155
|
+
this.nameToUuid.set(typed, uuid);
|
|
156
|
+
return typed;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const fallback = buildUuidFallbackSuffix(sanitized, uuid);
|
|
160
|
+
this.nameToUuid.set(fallback, uuid);
|
|
161
|
+
return fallback;
|
|
82
162
|
}
|
|
83
163
|
}
|
|
84
164
|
exports.MatterNameRegistry = MatterNameRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matter-name-sanitizer.js","sourceRoot":"","sources":["../../src/platform/matter-name-sanitizer.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"matter-name-sanitizer.js","sourceRoot":"","sources":["../../src/platform/matter-name-sanitizer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAuBH,kEAIC;AAzBD,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAElD,sFAAsF;AACtF,MAAM,aAAa,GAAG,kBAAkB,CAAC;AACzC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,SAAgB,2BAA2B,CAAC,IAAY,EAAE,QAAQ,GAAG,QAAQ;IACzE,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACzD,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACtB,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AACvC,CAAC;AAED,SAAS,KAAK,CAAC,GAAW;IACtB,IAAI,CAAC,GAAG,GAAG,CAAC;IACZ,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAClC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,OAAO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AAK,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YACrC,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,MAAM,KAAK,GAAG,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACtD,IAAI,KAAK,EAAE,CAAC;YACR,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACjD,IAAI,CAAC,aAAa,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;gBAC3C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBACjC,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;QAED,MAAM,QAAQ,GAAG,uBAAuB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAjCD,gDAiCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-plugin-klares4",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4-rc.2",
|
|
4
4
|
"description": "Plugin completo per sistemi Ksenia Lares4 - Zone, Luci, Tapparelle, Termostati, Sensori",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"ws": "^8.14.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^
|
|
40
|
+
"@types/node": "^25.9.1",
|
|
41
41
|
"@types/ws": "^8.5.0",
|
|
42
42
|
"homebridge": "^2.0.0-beta.0",
|
|
43
|
-
"typescript": "^
|
|
43
|
+
"typescript": "^6.0.3"
|
|
44
44
|
},
|
|
45
45
|
"author": {
|
|
46
46
|
"name": "Paolo Trivisonno",
|