homebridge-loxone-proxy 2.0.0 → 2.1.0-beta.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.
Files changed (159) hide show
  1. package/ARCHITECTURE.md +6 -30
  2. package/README.md +4 -4
  3. package/config.schema.json +6 -6
  4. package/dist/LoxonePlatform.d.ts +3 -8
  5. package/dist/LoxonePlatform.d.ts.map +1 -1
  6. package/dist/LoxonePlatform.js +35 -16
  7. package/dist/LoxonePlatform.js.map +1 -1
  8. package/package.json +6 -6
  9. package/test/customUi.test.js +3 -3
  10. package/dist/AccessoryNameRegistry.d.ts +0 -8
  11. package/dist/AccessoryNameRegistry.d.ts.map +0 -1
  12. package/dist/AccessoryNameRegistry.js +0 -53
  13. package/dist/AccessoryNameRegistry.js.map +0 -1
  14. package/dist/LoxoneConfig.d.ts +0 -18
  15. package/dist/LoxoneConfig.d.ts.map +0 -1
  16. package/dist/LoxoneConfig.js +0 -39
  17. package/dist/LoxoneConfig.js.map +0 -1
  18. package/dist/binding/BindingEngine.d.ts +0 -6
  19. package/dist/binding/BindingEngine.d.ts.map +0 -1
  20. package/dist/binding/BindingEngine.js +0 -44
  21. package/dist/binding/BindingEngine.js.map +0 -1
  22. package/dist/binding/CharacteristicBinding.d.ts +0 -10
  23. package/dist/binding/CharacteristicBinding.d.ts.map +0 -1
  24. package/dist/binding/CharacteristicBinding.js +0 -3
  25. package/dist/binding/CharacteristicBinding.js.map +0 -1
  26. package/dist/binding/ControlBinders.d.ts +0 -24
  27. package/dist/binding/ControlBinders.d.ts.map +0 -1
  28. package/dist/binding/ControlBinders.js +0 -295
  29. package/dist/binding/ControlBinders.js.map +0 -1
  30. package/dist/binding/LoxoneBindingCoordinator.d.ts +0 -34
  31. package/dist/binding/LoxoneBindingCoordinator.d.ts.map +0 -1
  32. package/dist/binding/LoxoneBindingCoordinator.js +0 -301
  33. package/dist/binding/LoxoneBindingCoordinator.js.map +0 -1
  34. package/dist/binding/RoomBridgePublisher.d.ts +0 -21
  35. package/dist/binding/RoomBridgePublisher.d.ts.map +0 -1
  36. package/dist/binding/RoomBridgePublisher.js +0 -156
  37. package/dist/binding/RoomBridgePublisher.js.map +0 -1
  38. package/dist/binding/ServiceResolver.d.ts +0 -12
  39. package/dist/binding/ServiceResolver.d.ts.map +0 -1
  40. package/dist/binding/ServiceResolver.js +0 -102
  41. package/dist/binding/ServiceResolver.js.map +0 -1
  42. package/dist/binding/binders/colorBinder.d.ts +0 -5
  43. package/dist/binding/binders/colorBinder.d.ts.map +0 -1
  44. package/dist/binding/binders/colorBinder.js +0 -107
  45. package/dist/binding/binders/colorBinder.js.map +0 -1
  46. package/dist/binding/binders/intercomBinder.d.ts +0 -5
  47. package/dist/binding/binders/intercomBinder.d.ts.map +0 -1
  48. package/dist/binding/binders/intercomBinder.js +0 -220
  49. package/dist/binding/binders/intercomBinder.js.map +0 -1
  50. package/dist/binding/binders/irrigationBinder.d.ts +0 -5
  51. package/dist/binding/binders/irrigationBinder.d.ts.map +0 -1
  52. package/dist/binding/binders/irrigationBinder.js +0 -89
  53. package/dist/binding/binders/irrigationBinder.js.map +0 -1
  54. package/dist/binding/binders/nfcCodeTouchBinder.d.ts +0 -6
  55. package/dist/binding/binders/nfcCodeTouchBinder.d.ts.map +0 -1
  56. package/dist/binding/binders/nfcCodeTouchBinder.js +0 -52
  57. package/dist/binding/binders/nfcCodeTouchBinder.js.map +0 -1
  58. package/dist/binding/colorMath.d.ts +0 -13
  59. package/dist/binding/colorMath.d.ts.map +0 -1
  60. package/dist/binding/colorMath.js +0 -55
  61. package/dist/binding/colorMath.js.map +0 -1
  62. package/dist/binding/hapError.d.ts +0 -3
  63. package/dist/binding/hapError.d.ts.map +0 -1
  64. package/dist/binding/hapError.js +0 -12
  65. package/dist/binding/hapError.js.map +0 -1
  66. package/dist/binding/tables/alarmBindings.d.ts +0 -4
  67. package/dist/binding/tables/alarmBindings.d.ts.map +0 -1
  68. package/dist/binding/tables/alarmBindings.js +0 -35
  69. package/dist/binding/tables/alarmBindings.js.map +0 -1
  70. package/dist/binding/tables/contactBindings.d.ts +0 -4
  71. package/dist/binding/tables/contactBindings.d.ts.map +0 -1
  72. package/dist/binding/tables/contactBindings.js +0 -16
  73. package/dist/binding/tables/contactBindings.js.map +0 -1
  74. package/dist/binding/tables/coveringBindings.d.ts +0 -6
  75. package/dist/binding/tables/coveringBindings.d.ts.map +0 -1
  76. package/dist/binding/tables/coveringBindings.js +0 -88
  77. package/dist/binding/tables/coveringBindings.js.map +0 -1
  78. package/dist/binding/tables/fanBindings.d.ts +0 -7
  79. package/dist/binding/tables/fanBindings.d.ts.map +0 -1
  80. package/dist/binding/tables/fanBindings.js +0 -40
  81. package/dist/binding/tables/fanBindings.js.map +0 -1
  82. package/dist/binding/tables/lightingBindings.d.ts +0 -4
  83. package/dist/binding/tables/lightingBindings.d.ts.map +0 -1
  84. package/dist/binding/tables/lightingBindings.js +0 -18
  85. package/dist/binding/tables/lightingBindings.js.map +0 -1
  86. package/dist/binding/tables/moodBindings.d.ts +0 -4
  87. package/dist/binding/tables/moodBindings.d.ts.map +0 -1
  88. package/dist/binding/tables/moodBindings.js +0 -14
  89. package/dist/binding/tables/moodBindings.js.map +0 -1
  90. package/dist/binding/tables/pushbuttonBindings.d.ts +0 -4
  91. package/dist/binding/tables/pushbuttonBindings.d.ts.map +0 -1
  92. package/dist/binding/tables/pushbuttonBindings.js +0 -12
  93. package/dist/binding/tables/pushbuttonBindings.js.map +0 -1
  94. package/dist/binding/tables/radioBindings.d.ts +0 -4
  95. package/dist/binding/tables/radioBindings.d.ts.map +0 -1
  96. package/dist/binding/tables/radioBindings.js +0 -19
  97. package/dist/binding/tables/radioBindings.js.map +0 -1
  98. package/dist/binding/tables/sensorBindings.d.ts +0 -10
  99. package/dist/binding/tables/sensorBindings.d.ts.map +0 -1
  100. package/dist/binding/tables/sensorBindings.js +0 -25
  101. package/dist/binding/tables/sensorBindings.js.map +0 -1
  102. package/dist/binding/tables/smokeAlarmBindings.d.ts +0 -4
  103. package/dist/binding/tables/smokeAlarmBindings.d.ts.map +0 -1
  104. package/dist/binding/tables/smokeAlarmBindings.js +0 -22
  105. package/dist/binding/tables/smokeAlarmBindings.js.map +0 -1
  106. package/dist/binding/tables/switchBindings.d.ts +0 -5
  107. package/dist/binding/tables/switchBindings.d.ts.map +0 -1
  108. package/dist/binding/tables/switchBindings.js +0 -36
  109. package/dist/binding/tables/switchBindings.js.map +0 -1
  110. package/dist/binding/tables/thermostatBindings.d.ts +0 -4
  111. package/dist/binding/tables/thermostatBindings.d.ts.map +0 -1
  112. package/dist/binding/tables/thermostatBindings.js +0 -48
  113. package/dist/binding/tables/thermostatBindings.js.map +0 -1
  114. package/dist/homekit/hksv/FfmpegStreamingProcess.d.ts +0 -30
  115. package/dist/homekit/hksv/FfmpegStreamingProcess.d.ts.map +0 -1
  116. package/dist/homekit/hksv/FfmpegStreamingProcess.js +0 -133
  117. package/dist/homekit/hksv/FfmpegStreamingProcess.js.map +0 -1
  118. package/dist/homekit/hksv/LoxoneTalkback.d.ts +0 -72
  119. package/dist/homekit/hksv/LoxoneTalkback.d.ts.map +0 -1
  120. package/dist/homekit/hksv/LoxoneTalkback.js +0 -695
  121. package/dist/homekit/hksv/LoxoneTalkback.js.map +0 -1
  122. package/dist/homekit/hksv/Prebuffer.d.ts +0 -33
  123. package/dist/homekit/hksv/Prebuffer.d.ts.map +0 -1
  124. package/dist/homekit/hksv/Prebuffer.js +0 -194
  125. package/dist/homekit/hksv/Prebuffer.js.map +0 -1
  126. package/dist/homekit/hksv/RecordingDelegate.d.ts +0 -58
  127. package/dist/homekit/hksv/RecordingDelegate.d.ts.map +0 -1
  128. package/dist/homekit/hksv/RecordingDelegate.js +0 -493
  129. package/dist/homekit/hksv/RecordingDelegate.js.map +0 -1
  130. package/dist/homekit/hksv/StreamingDelegate.d.ts +0 -54
  131. package/dist/homekit/hksv/StreamingDelegate.d.ts.map +0 -1
  132. package/dist/homekit/hksv/StreamingDelegate.js +0 -744
  133. package/dist/homekit/hksv/StreamingDelegate.js.map +0 -1
  134. package/dist/homekit/hksv/ffmpegArgs.d.ts +0 -3
  135. package/dist/homekit/hksv/ffmpegArgs.d.ts.map +0 -1
  136. package/dist/homekit/hksv/ffmpegArgs.js +0 -22
  137. package/dist/homekit/hksv/ffmpegArgs.js.map +0 -1
  138. package/dist/homekit/hksv/rsa.d.ts +0 -3
  139. package/dist/homekit/hksv/rsa.d.ts.map +0 -1
  140. package/dist/homekit/hksv/rsa.js +0 -144
  141. package/dist/homekit/hksv/rsa.js.map +0 -1
  142. package/dist/homekit/hksv/sdp.d.ts +0 -12
  143. package/dist/homekit/hksv/sdp.d.ts.map +0 -1
  144. package/dist/homekit/hksv/sdp.js +0 -167
  145. package/dist/homekit/hksv/sdp.js.map +0 -1
  146. package/dist/homekit/services/Camera.d.ts +0 -22
  147. package/dist/homekit/services/Camera.d.ts.map +0 -1
  148. package/dist/homekit/services/Camera.js +0 -74
  149. package/dist/homekit/services/Camera.js.map +0 -1
  150. package/dist/homekit/services/CameraMotionSensor.d.ts +0 -42
  151. package/dist/homekit/services/CameraMotionSensor.d.ts.map +0 -1
  152. package/dist/homekit/services/CameraMotionSensor.js +0 -175
  153. package/dist/homekit/services/CameraMotionSensor.js.map +0 -1
  154. package/dist/homekit/services/Doorbell.d.ts +0 -11
  155. package/dist/homekit/services/Doorbell.d.ts.map +0 -1
  156. package/dist/homekit/services/Doorbell.js +0 -23
  157. package/dist/homekit/services/Doorbell.js.map +0 -1
  158. package/test/binding.test.js +0 -661
  159. package/test/support.test.js +0 -137
package/ARCHITECTURE.md CHANGED
@@ -6,38 +6,14 @@ This plugin has one product boundary: Loxone <-> HomeKit. The architecture is op
6
6
 
7
7
  | Layer | Module(s) | Owns | Must not own |
8
8
  | --- | --- | --- | --- |
9
- | Platform | `LoxonePlatform`, `index.ts` | Homebridge lifecycle, the accessory cache list, the name registry, exposing HAP `Service`/`Characteristic`. | Loxone protocol details or item semantics. |
10
- | Loxone transport | [`loxone-ts-client`](https://www.npmjs.com/package/loxone-ts-client) (external dependency) | All Miniserver communication: websocket, token auth, Structure File parsing, encrypted commands, state subscriptions, and the typed room/control model. | HomeKit concepts. |
11
- | Binding coordinator | `LoxoneBindingCoordinator` | Connection orchestration, per-room control discovery, accessory planning, reconciliation (create/update/restore/remove), routing accessories to the main or a per-room bridge, room/type filtering, central-room handling. | HAP characteristic specifics — it delegates those. |
12
- | Control routing | `ControlBinders` (`CONTROL_BINDERS`, `COMPOSITE_BINDERS`) | Mapping each Loxone control `type` to a `PlannedAccessory` (which HomeKit service(s) and which bindings). | Talking to the Miniserver. |
13
- | Binding tables | `binding/tables/*Bindings.ts` | Declarative characteristic ⇄ state/command bindings per control family (lighting, covering, fan, sensor, thermostat, alarm, radio, switch, pushbutton, mood, contact, smoke). | Imperative service construction. |
14
- | Binding engine | `BindingEngine.bindCharacteristics`, `CharacteristicBinding`, `ServiceResolver` | Applying a binding: wiring a HAP characteristic to a control's Loxone state (`handle.onState`) and command (`handle.send`). | Inventing command strings or reaching past the typed handle. |
15
- | Complex binders | `binding/binders/*` | Imperative wiring for controls that are not a simple table: `intercom` (+ HKSV), `nfcCodeTouch`, `irrigation`, `color`. | Generic command/state rules where a table suffices. |
16
- | Per-room publishing | `RoomBridgePublisher` | One HAP `Bridge` per room, deterministic pairing identity, and the manifest the config UI reads. | Loxone semantics. |
17
- | Naming | `AccessoryNameRegistry` | Clean, unique, HAP-safe, UUID-stable accessory names. | — |
18
- | Media | `homekit/hksv/*`, `homekit/services/*` | Camera streaming, HKSV recording + prebuffer, doorbell, motion, WebRTC talkback. | Generic command/state routing. |
9
+ | Platform (host) | `LoxonePlatform`, `index.ts` | Homebridge lifecycle and the accessory cache: implements `HomeKitHost` on Homebridge's API. The only modules that import `homebridge`. | Loxone protocol details or item semantics. |
10
+ | Core | [`loxone-homekit`](https://github.com/rudyberends/loxone-homekit) (external dependency) | Everything Loxone ⇄ HomeKit: binding coordinator, control binders and tables, room bridges, naming, HKSV/intercom media. See its ARCHITECTURE.md. | Homebridge specifics. |
11
+ | Loxone transport | [`loxone-ts-client`](https://www.npmjs.com/package/loxone-ts-client) (via the core; also used directly by the config UI for discovery) | All Miniserver communication. | HomeKit concepts. |
12
+ | Config UI | `homebridge-ui/` | Miniserver discovery, room settings, room-bridge pairing codes (from the core's manifest). | Binding logic; its `SUPPORTED_TYPES` copy is checked against the core's `SUPPORTED_CONTROL_TYPES` by a test. |
19
13
 
20
- ## Command And State Rules
14
+ New Loxone controls, HomeKit mappings and media fixes belong in `loxone-homekit`; this plugin only changes for Homebridge-side concerns (lifecycle, cache, config schema, config UI).
21
15
 
22
- - A control's HomeKit shape, its Loxone state UUIDs, and its commands live in the declarative binding tables (or in a binder, for complex controls).
23
- - Bindings reach the Miniserver only through the typed `ControlHandle` from `loxone-ts-client`: read state via `handle.state(...)` / `handle.onState(...)`, send via `handle.send(...)`.
24
- - The plugin has no hand-rolled command bus or state router; the library's typed handles own subscription and dispatch. Do not re-implement that layer.
25
- - Binders and tables must not reach into the raw `loxone-ts-client` client/transport directly — go through the control handle.
26
- - HomeKit service code must not talk to the transport directly.
27
-
28
- ## Transport Boundary
29
-
30
- `loxone-ts-client` is a separately published, independently versioned npm package. It owns every Loxone protocol concern and exposes typed control handles, a room view, and Miniserver discovery. This plugin depends on it and adds only the HomeKit binding layer, which keeps the boundary clean:
31
-
32
- - tests can run without a Miniserver;
33
- - the binding coordinator stays independent of concrete protocol event shapes;
34
- - transport behavior can evolve in `loxone-ts-client` without leaking into HomeKit mapping code.
35
-
36
- ## Intercom & Media Boundary
37
-
38
- Intercom and IntercomV2 are intentionally a separate bounded context. They include HKSV, WebRTC signaling, prebuffering, talkback, camera streams, and Miniserver token use — flows that are not the same as normal command/state accessories. They live in `homekit/hksv/*` and `homekit/services/*`, wired up by `binding/binders/intercomBinder.ts`.
39
-
40
- The command/state architecture still plans the regular Doorbell/Camera/MotionSensor accessory where useful, but the media and signaling code stays isolated from the generic binding tables and the `ControlHandle` command/state rules.
16
+ The plugin keeps `@homebridge/camera-utils`, `ffmpeg-for-homebridge` and `@roamhq/wrtc` as dependencies: they are optional peers of the core, needed here for intercom video and talkback.
41
17
 
42
18
  ## Release Rules
43
19
 
package/README.md CHANGED
@@ -20,7 +20,7 @@ It retrieves the Loxone [Structure-File](https://www.loxone.com/wp-content/uploa
20
20
 
21
21
  # Architecture
22
22
 
23
- This plugin is intentionally focused on one integration path: Loxone <-> HomeKit. The current architecture keeps that path explicit:
23
+ This plugin is intentionally focused on one integration path: Loxone <-> HomeKit. The Loxone ⇄ HomeKit core lives in the [`loxone-homekit`](https://github.com/rudyberends/loxone-homekit) package, which other hosts can use too; this plugin is the Homebridge host around it. The architecture keeps that path explicit:
24
24
 
25
25
  | Layer | Responsibility |
26
26
  | --- | --- |
@@ -53,10 +53,10 @@ The following list displays all supported itemtypes supported by this plugin.
53
53
  |`IRoomControllerV2` | Thermostat | Auto
54
54
  |`Jalousie` | Window Covering | Auto
55
55
  |`Leak` | LeakSensor | Manual | InfoOnlyDigital Item. Requires a mapping.
56
- |`LightControllerV2` | MoodSwitch, Lightbulb | Auto | When enabled, all LightControllerV2 moods are mapped to a Switch Group as a seperate switch. Individual lights are mapped to a Lightbulb.
56
+ |`LightControllerV2` | MoodSwitch, Lightbulb | Auto | When enabled, all LightControllerV2 moods are mapped to Outlets (grouped in one Moods accessory, or one accessory per mood). Individual lights are mapped to a Lightbulb.
57
57
  |`Lock` | LockMechanism | Manual | Switch Item. Requires a mapping. By default, it expects the switch to be ON for the dooor to be locked. There is an option in the config to reverse this behavior.
58
58
  |`Motion` | MotionSensor | Manual | InfoOnlyDigital Item. Requires a mapping.
59
- |`NfcCodeTouch` | Doorbell, MotionSensor | Auto | It will map to a Doorbell by default. There is an advanced switch in the config to set it to MotionSensor.
59
+ |`NfcCodeTouch` | MotionSensor | Auto | Triggers on every access (code, NFC tag or app, granted or denied). Can be disabled under Advanced. The keypad's bell button isn't part of this block: wire it to an Intercom block to get a HomeKit doorbell.
60
60
  |`PresenceDetector` | OccupancySensor | Auto
61
61
  |`Radio` | Switch (Group) | Auto | All Radio outputs are mapped to a Switch Group as a seperate switch.
62
62
  |`Smoke` | SmokeSensor | Manual | InfoOnlyDigital Item. Requires a mapping.
@@ -115,7 +115,7 @@ HomeKit's biggest quirk with a single bridge is that **all** of that bridge's ac
115
115
  **Pairing workflow** — this is what makes the room assignment stick: in the Home app, first open the **target room**, then tap **Add Accessory → More options…**, pick the room's bridge and enter the code shown in the UI. HomeKit drops the freshly-paired accessories into the room you had open.
116
116
 
117
117
  ## Mood switches
118
- Set on the Options tab. **Grouped** (default) puts all moods of a LightControllerV2 as switches in one Moods accessory per light controller. **Separate** gives every mood its own Switch accessory, so each mood can be placed on its own (e.g. in Control Center). **Disabled** exposes no moods. In HomeKit this behaves like a radio group: only one mood can be active at a time, and mixing moods is not possible.
118
+ Set on the Options tab. **Grouped** (default) puts all moods of a LightControllerV2 in one Moods accessory per light controller. Moods are exposed as Outlets rather than Switches, so Home shows them as a grouped tile of buttons in Control Center instead of separate sliders. **Separate** gives every mood its own accessory, so each mood can be placed on its own (e.g. in Control Center). **Disabled** exposes no moods. In HomeKit this behaves like a radio group: only one mood can be active at a time, and mixing moods is not possible.
119
119
 
120
120
  ## Manual mapping (aliases)
121
121
  Some items cannot be classified automatically and need a naming convention. For example, give all Brightness sensors the convention `MH0'XX'` in Loxone Config
@@ -39,7 +39,7 @@
39
39
  "properties": {
40
40
  "MoodSwitches": {
41
41
  "title": "Mood switches",
42
- "description": "How LightControllerV2 moods appear in HomeKit: grouped as switches in one Moods accessory per light controller, or as a separate accessory per mood.",
42
+ "description": "How LightControllerV2 moods appear in HomeKit: grouped as outlets in one Moods accessory per light controller, or as a separate accessory per mood.",
43
43
  "type": "string",
44
44
  "default": "enabled",
45
45
  "oneOf": [
@@ -57,10 +57,10 @@
57
57
  "NfcCodeTouchMapping": {
58
58
  "title": "NFC Code Touch mapping",
59
59
  "type": "string",
60
- "default": "DoorBell",
61
- "enum": [
62
- "DoorBell",
63
- "MotionSensor"
60
+ "default": "MotionSensor",
61
+ "oneOf": [
62
+ { "title": "Motion sensor (triggers on every access)", "enum": ["MotionSensor"] },
63
+ { "title": "Disabled", "enum": ["Disabled"] }
64
64
  ]
65
65
  },
66
66
  "MotionTriggersDoorbell": {
@@ -243,7 +243,7 @@
243
243
  "type": "fieldset",
244
244
  "expandable": true,
245
245
  "title": "NFC Code Touch",
246
- "description": "How an NFC Code Touch appears in HomeKit — as a doorbell or a motion sensor.",
246
+ "description": "An NFC Code Touch appears in HomeKit as a motion sensor that triggers on every access (code, NFC tag or app, granted or denied). The keypad's bell button is not part of this block: wire it to an Intercom block in Loxone Config to get a HomeKit doorbell.",
247
247
  "items": [
248
248
  "Advanced.NfcCodeTouchMapping"
249
249
  ]
@@ -1,17 +1,12 @@
1
- import { API, Characteristic, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service } from 'homebridge';
1
+ import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig } from 'homebridge';
2
2
  export declare class LoxonePlatform implements DynamicPlatformPlugin {
3
3
  readonly log: Logger;
4
4
  readonly config: PlatformConfig;
5
5
  readonly api: API;
6
- readonly Service: typeof Service;
7
- readonly Characteristic: typeof Characteristic;
8
6
  readonly accessories: PlatformAccessory[];
9
- private readonly nameRegistry;
10
- private readonly bindingCoordinator;
7
+ private readonly homekit;
11
8
  constructor(log: Logger, config: PlatformConfig, api: API);
12
9
  configureAccessory(accessory: PlatformAccessory): void;
13
- generateUniqueName(room: string, base: string, uuid?: string, isSubItem?: boolean, prefixRoom?: boolean): string;
14
- getCommunicationToken(): string | undefined;
15
- getTemperatureDisplayUnit(): number;
10
+ private host;
16
11
  }
17
12
  //# sourceMappingURL=LoxonePlatform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoxonePlatform.d.ts","sourceRoot":"","sources":["../src/LoxonePlatform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG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,GAAG;IAe1B,kBAAkB,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;IAKtD,OAAO,CAAC,IAAI;CAgCb"}
@@ -1,37 +1,56 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LoxonePlatform = void 0;
4
- const AccessoryNameRegistry_1 = require("./AccessoryNameRegistry");
5
- const LoxoneBindingCoordinator_1 = require("./binding/LoxoneBindingCoordinator");
4
+ const loxone_homekit_1 = require("loxone-homekit");
5
+ const PLUGIN_NAME = 'homebridge-loxone-proxy';
6
+ const PLATFORM_NAME = 'LoxonePlatform';
6
7
  class LoxonePlatform {
7
8
  constructor(log, config, api) {
8
9
  this.log = log;
9
10
  this.config = config;
10
11
  this.api = api;
11
- this.Service = this.api.hap.Service;
12
- this.Characteristic = this.api.hap.Characteristic;
13
12
  this.accessories = [];
14
- this.nameRegistry = new AccessoryNameRegistry_1.AccessoryNameRegistry();
15
- this.bindingCoordinator = new LoxoneBindingCoordinator_1.LoxoneBindingCoordinator(this);
13
+ this.homekit = new loxone_homekit_1.LoxoneHomeKit(this.host());
16
14
  this.api.on('didFinishLaunching', () => {
17
- void this.bindingCoordinator.start();
15
+ void this.homekit.start();
18
16
  });
19
17
  this.api.on("shutdown", () => {
20
- void this.bindingCoordinator.stop();
18
+ void this.homekit.stop();
21
19
  });
22
20
  }
23
21
  configureAccessory(accessory) {
24
22
  this.log.debug('Loaded from cache:', accessory.displayName);
25
23
  this.accessories.push(accessory);
26
24
  }
27
- generateUniqueName(room, base, uuid, isSubItem = false, prefixRoom = true) {
28
- return this.nameRegistry.generate(room, base, uuid, isSubItem, prefixRoom);
29
- }
30
- getCommunicationToken() {
31
- return this.bindingCoordinator.token;
32
- }
33
- getTemperatureDisplayUnit() {
34
- return this.bindingCoordinator.temperatureUnit;
25
+ host() {
26
+ const api = this.api;
27
+ const cached = this.accessories;
28
+ const accessories = {
29
+ all: () => cached,
30
+ create: (displayName, uuid) => new api.platformAccessory(displayName, uuid),
31
+ register: (accessory) => {
32
+ api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
33
+ cached.push(accessory);
34
+ },
35
+ unregister: (accessory) => {
36
+ const index = cached.findIndex((acc) => acc.UUID === accessory.UUID);
37
+ if (index !== -1) {
38
+ cached.splice(index, 1);
39
+ }
40
+ api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
41
+ },
42
+ hapAccessory: (accessory) => accessory._associatedHAPAccessory,
43
+ };
44
+ return {
45
+ hap: api.hap,
46
+ log: this.log,
47
+ config: this.config,
48
+ storagePath: api.user.storagePath(),
49
+ accessories,
50
+ onShutdown: (listener) => {
51
+ api.on("shutdown", listener);
52
+ },
53
+ };
35
54
  }
36
55
  }
37
56
  exports.LoxonePlatform = LoxonePlatform;
@@ -1 +1 @@
1
- {"version":3,"file":"LoxonePlatform.js","sourceRoot":"","sources":["../src/LoxonePlatform.ts"],"names":[],"mappings":";;;AAWA,mEAAgE;AAChE,iFAA8E;AAQ9E,MAAa,cAAc;IASzB,YACkB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAFR,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QAXV,YAAO,GAAmB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/C,mBAAc,GAA0B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QAEpE,gBAAW,GAAwB,EAAE,CAAC;QAUpD,IAAI,CAAC,YAAY,GAAG,IAAI,6CAAqB,EAAE,CAAC;QAChD,IAAI,CAAC,kBAAkB,GAAG,IAAI,mDAAwB,CAAC,IAAI,CAAC,CAAC;QAE7D,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;YACrC,KAAK,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QACvC,CAAC,CAA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AAC;gBACD,GAAG,CAAC,6BAA6B,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC,SAA8B,CAAC,CAAC,CAAC;YAClG,CAAC;YAED,YAAY,EAAE,CAAC,SAA2B,EAAE,EAAE,CAC3C,SAA+D,CAAC,uBAAuB;SAC3F,CAAC;QACF,OAAO;YACL,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE;YACnC,WAAW;YACX,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE;gBACvB,GAAG,CAAC,EAAE,aAAoB,QAAQ,CAAC,CAAC;YACtC,CAAC;SACF,CAAC;IACJ,CAAC;CACF;AA3DD,wCA2DC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "displayName": "Homebridge Loxone Proxy",
4
4
  "name": "homebridge-loxone-proxy",
5
- "version": "2.0.0",
5
+ "version": "2.1.0-beta.2",
6
6
  "description": "Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit.",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {
@@ -37,21 +37,21 @@
37
37
  "@homebridge/plugin-ui-utils": "^1.0.3",
38
38
  "@roamhq/wrtc": "^0.10.0",
39
39
  "ffmpeg-for-homebridge": "^2.1.7",
40
- "loxone-ts-client": "^0.2.0",
41
- "pick-port": "^2.1.0",
42
- "ws": "^8.19.0"
40
+ "loxone-homekit": "^1.0.0",
41
+ "loxone-ts-client": "^0.4.0",
42
+ "pick-port": "^2.1.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^22.10.0",
46
46
  "@types/sharp": "^0.32.0",
47
- "@types/ws": "^8.18.1",
48
47
  "@typescript-eslint/eslint-plugin": "^5.0.0",
49
48
  "@typescript-eslint/parser": "^5.0.0",
50
49
  "eslint": "^8.0.1",
50
+ "hap-nodejs": "^0.11.2",
51
51
  "homebridge": "^1.3.5",
52
52
  "nodemon": "^2.0.20",
53
53
  "rimraf": "^3.0.2",
54
- "semantic-release": "^24.2.9",
54
+ "semantic-release": "^25.0.9",
55
55
  "ts-node": "^10.3.0",
56
56
  "typescript": "^5.7.0"
57
57
  },
@@ -3,19 +3,19 @@ const test = require('node:test');
3
3
  const { readFileSync } = require('node:fs');
4
4
  const { resolve } = require('node:path');
5
5
 
6
- const { MIGRATED_CONTROL_TYPES } = require('../dist/binding/ControlBinders');
6
+ const { SUPPORTED_CONTROL_TYPES } = require('loxone-homekit');
7
7
 
8
8
  // The custom config UI server (homebridge-ui/server.js) hardcodes the list of
9
9
  // HomeKit-mapped control types so it stays lightweight (no binding-graph import
10
10
  // in the Homebridge UI process). This guards that copy against drift from the
11
11
  // real binder registry.
12
- test('homebridge-ui SUPPORTED_TYPES mirrors MIGRATED_CONTROL_TYPES', () => {
12
+ test('homebridge-ui SUPPORTED_TYPES mirrors loxone-homekit SUPPORTED_CONTROL_TYPES', () => {
13
13
  const source = readFileSync(resolve(__dirname, '../homebridge-ui/server.js'), 'utf8');
14
14
  const block = source.match(/const SUPPORTED_TYPES = new Set\(\[([\s\S]*?)\]\)/);
15
15
  assert.ok(block, 'could not find SUPPORTED_TYPES in homebridge-ui/server.js');
16
16
 
17
17
  const uiTypes = new Set([...block[1].matchAll(/'([^']+)'/g)].map((m) => m[1]));
18
- const realTypes = new Set(MIGRATED_CONTROL_TYPES);
18
+ const realTypes = new Set(SUPPORTED_CONTROL_TYPES);
19
19
 
20
20
  const missingInUi = [...realTypes].filter((t) => !uiTypes.has(t));
21
21
  const staleInUi = [...uiTypes].filter((t) => !realTypes.has(t));
@@ -1,8 +0,0 @@
1
- export declare function sanitizeName(value: string): string;
2
- export declare class AccessoryNameRegistry {
3
- private readonly usedNames;
4
- private readonly accessoryNameMap;
5
- generate(room: string, base: string, uuid?: string, isSubItem?: boolean, prefixRoom?: boolean): string;
6
- private clean;
7
- }
8
- //# sourceMappingURL=AccessoryNameRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccessoryNameRegistry.d.ts","sourceRoot":"","sources":["../src/AccessoryNameRegistry.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMlD;AAOD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA6B;IAE9D,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,UAAQ,EAAE,UAAU,UAAO,GAAG,MAAM;IA6CjG,OAAO,CAAC,KAAK;CAGd"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AccessoryNameRegistry = void 0;
4
- exports.sanitizeName = sanitizeName;
5
- function sanitizeName(value) {
6
- return value
7
- .replace(/\((.*?)\)/g, '$1')
8
- .replace(/[^\p{L}\p{N}\s']/gu, '')
9
- .replace(/\s+/g, ' ')
10
- .trim();
11
- }
12
- class AccessoryNameRegistry {
13
- constructor() {
14
- this.usedNames = new Set();
15
- this.accessoryNameMap = new Map();
16
- }
17
- generate(room, base, uuid, isSubItem = false, prefixRoom = true) {
18
- const cleanRoom = this.clean(room || 'Unknown');
19
- const cleanBase = this.clean(base || 'Unnamed');
20
- if (!prefixRoom) {
21
- const lead = cleanRoom.toLowerCase() + ' ';
22
- return cleanBase.toLowerCase().startsWith(lead)
23
- ? cleanBase.slice(cleanRoom.length).trim() || cleanBase
24
- : cleanBase;
25
- }
26
- const alreadyPrefixed = cleanBase.toLowerCase().startsWith(cleanRoom.toLowerCase()) ||
27
- cleanBase.toLowerCase().startsWith(cleanRoom.toLowerCase() + ' ');
28
- const baseName = alreadyPrefixed
29
- ? cleanBase
30
- : `${cleanRoom} ${cleanBase}`;
31
- if (isSubItem) {
32
- return baseName;
33
- }
34
- if (uuid && this.accessoryNameMap.has(uuid)) {
35
- return this.accessoryNameMap.get(uuid);
36
- }
37
- let finalName = baseName;
38
- let counter = 1;
39
- while (this.usedNames.has(finalName)) {
40
- finalName = `${baseName} ${counter++}`;
41
- }
42
- this.usedNames.add(finalName);
43
- if (uuid) {
44
- this.accessoryNameMap.set(uuid, finalName);
45
- }
46
- return finalName;
47
- }
48
- clean(value) {
49
- return sanitizeName(value);
50
- }
51
- }
52
- exports.AccessoryNameRegistry = AccessoryNameRegistry;
53
- //# sourceMappingURL=AccessoryNameRegistry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccessoryNameRegistry.js","sourceRoot":"","sources":["../src/AccessoryNameRegistry.ts"],"names":[],"mappings":";;;AAOA,oCAMC;AAND,SAAgB,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK;SACT,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC;SAC3B,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC;SACjC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AACZ,CAAC;AAOD,MAAa,qBAAqB;IAAlC;QACmB,cAAS,GAAG,IAAI,GAAG,EAAU,CAAC;QAC9B,qBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAkDhE,CAAC;IAhDC,QAAQ,CAAC,IAAY,EAAE,IAAY,EAAE,IAAa,EAAE,SAAS,GAAG,KAAK,EAAE,UAAU,GAAG,IAAI;QACtF,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC;QAIhD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC;YAC3C,OAAO,SAAS,CAAC,W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CACF;AApDD,sDAoDC"}
@@ -1,18 +0,0 @@
1
- import { PlatformConfig } from 'homebridge';
2
- export type RoomFilterType = 'inclusion' | 'exclusion';
3
- export interface NormalizedLoxoneConfig {
4
- excludedTypes: string[];
5
- roomFilter: {
6
- type: RoomFilterType;
7
- rooms: string[];
8
- };
9
- }
10
- export interface LoxoneConnectionConfig {
11
- host?: unknown;
12
- port?: unknown;
13
- username?: unknown;
14
- password?: unknown;
15
- }
16
- export declare function normalizeLoxoneConfig(config: PlatformConfig): NormalizedLoxoneConfig;
17
- export declare function validateLoxoneConnectionConfig(config: LoxoneConnectionConfig): string[];
18
- //# sourceMappingURL=LoxoneConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoxoneConfig.d.ts","sourceRoot":"","sources":["../src/LoxoneConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,WAAW,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE;QACV,IAAI,EAAE,cAAc,CAAC;QACrB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,sBAAsB,CAQpF;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,CAuBvF"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeLoxoneConfig = normalizeLoxoneConfig;
4
- exports.validateLoxoneConnectionConfig = validateLoxoneConnectionConfig;
5
- function normalizeLoxoneConfig(config) {
6
- return {
7
- excludedTypes: parseList(config.Exclusions),
8
- roomFilter: {
9
- type: config.roomfilter?.type === 'inclusion' ? 'inclusion' : 'exclusion',
10
- rooms: parseList(config.roomfilter?.list).map(room => room.toLowerCase()),
11
- },
12
- };
13
- }
14
- function validateLoxoneConnectionConfig(config) {
15
- const errors = [];
16
- if (!isNonEmptyString(config.host)) {
17
- errors.push('host is required');
18
- }
19
- if (!isNonEmptyString(config.username)) {
20
- errors.push('username is required');
21
- }
22
- if (!isNonEmptyString(config.password)) {
23
- errors.push('password is required');
24
- }
25
- if (config.port !== undefined && config.port !== null && config.port !== '') {
26
- const port = Number(config.port);
27
- if (!Number.isInteger(port) || port < 1 || port > 65535) {
28
- errors.push('port must be a number between 1 and 65535');
29
- }
30
- }
31
- return errors;
32
- }
33
- function parseList(value) {
34
- return value?.split(',').map(item => item.trim()).filter(Boolean) ?? [];
35
- }
36
- function isNonEmptyString(value) {
37
- return typeof value === 'string' && value.trim().length > 0;
38
- }
39
- //# sourceMappingURL=LoxoneConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoxoneConfig.js","sourceRoot":"","sources":["../src/LoxoneConfig.ts"],"names":[],"mappings":";;AAmBA,sDAQC;AAED,wEAuBC;AAjCD,SAAgB,qBAAqB,CAAC,MAAsB;IAC1D,OAAO;QACL,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC;QAC3C,UAAU,EAAE;YACV,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;YACzE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;SAC1E;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,8BAA8B,CAA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
1
- import type { Service } from 'homebridge';
2
- import type { ControlHandle } from 'loxone-ts-client';
3
- import type { LoxonePlatform } from '../LoxonePlatform';
4
- import type { BindingTable } from './CharacteristicBinding';
5
- export declare function bindCharacteristics<H extends ControlHandle>(platform: LoxonePlatform, service: Service, handle: H, bindings: BindingTable<H>): () => void;
6
- //# sourceMappingURL=BindingEngine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BindingEngine.d.ts","sourceRoot":"","sources":["../../src/binding/BindingEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,OAAO,EAAY,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAgB5D,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,aAAa,EACzD,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GACxB,MAAM,IAAI,CA0CZ"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bindCharacteristics = bindCharacteristics;
4
- const hapError_1 = require("./hapError");
5
- function bindCharacteristics(platform, service, handle, bindings) {
6
- const disposers = [];
7
- const characteristics = platform.Characteristic;
8
- for (const binding of bindings) {
9
- const ctor = characteristics[binding.char];
10
- if (!ctor) {
11
- platform.log.warn(`[BindingEngine] Unknown characteristic "${binding.char}" on ${handle.name}`);
12
- continue;
13
- }
14
- const characteristic = service.getCharacteristic(ctor);
15
- characteristic.onGet(() => binding.get(handle));
16
- if (binding.set) {
17
- const set = binding.set;
18
- characteristic.onSet(async (value) => {
19
- try {
20
- await set(handle, value);
21
- }
22
- catch (error) {
23
- throw (0, hapError_1.toHapStatusError)(platform, error);
24
- }
25
- });
26
- }
27
- for (const state of toArray(binding.subscribeTo)) {
28
- try {
29
- disposers.push(handle.onState(state, () => characteristic.updateValue(binding.get(handle)), { emitCurrent: true }));
30
- }
31
- catch (error) {
32
- platform.log.warn(`[BindingEngine] ${handle.name}: cannot subscribe to "${state}" for ${binding.char} (${error.message})`);
33
- }
34
- }
35
- }
36
- return () => disposers.forEach((dispose) => dispose());
37
- }
38
- function toArray(value) {
39
- if (value === undefined) {
40
- return [];
41
- }
42
- return Array.isArray(value) ? value : [value];
43
- }
44
- //# sourceMappingURL=BindingEngine.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BindingEngine.js","sourceRoot":"","sources":["../../src/binding/BindingEngine.ts"],"names":[],"mappings":";;AAmBA,kDA+CC;AA9DD,yCAA8C;AAe9C,SAAgB,mBAAmB,CACjC,QAAwB,EACxB,OAAgB,EAChB,MAAS,EACT,QAAyB;IAEzB,MAAM,SAAS,GAAsB,EAAE,CAAC;IACxC,MAAM,eAAe,GAAG,QAAQ,CAAC,cAAsE,CAAC;IAExG,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,2CAA2C,OAAO,CAAC,IAAI,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YAChG,SAAS;QACX,CAAC;QAED,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACvD,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QAEhD,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YACxB,cAAc,CAAC,KAAK,CAA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haracteristicBinding<H extends ControlHandle> {
4
- char: string;
5
- get: (handle: H) => CharacteristicValue;
6
- set?: (handle: H, value: CharacteristicValue) => Promise<unknown>;
7
- subscribeTo?: string | string[];
8
- }
9
- export type BindingTable<H extends ControlHandle> = ReadonlyArray<CharacteristicBinding<H>>;
10
- //# sourceMappingURL=CharacteristicBinding.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CharacteristicBinding.d.ts","sourceRoot":"","sources":["../../src/binding/CharacteristicBinding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAWtD,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,aAAa;IAE5D,IAAI,EAAE,MAAM,CAAC;IAEb,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,mBAAmB,CAAC;IAExC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAKlE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACjC;AAGD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,aAAa,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=CharacteristicBinding.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CharacteristicBinding.js","sourceRoot":"","sources":["../../src/binding/CharacteristicBinding.ts"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import type { PlatformAccessory, Service, WithUUID } from 'homebridge';
2
- import type { ControlHandle, LoxoneClient } from 'loxone-ts-client';
3
- import type { LoxonePlatform } from '../LoxonePlatform';
4
- export interface ServiceBinding {
5
- kind: WithUUID<typeof Service>;
6
- subtype?: string;
7
- name?: string;
8
- bindTo: (service: Service) => () => void;
9
- }
10
- export type ControlBinder = (platform: LoxonePlatform, handle: ControlHandle) => ServiceBinding[];
11
- export interface PlannedAccessory {
12
- uuidSource: string;
13
- type: string;
14
- name: string;
15
- room: string;
16
- services: ServiceBinding[];
17
- bindAccessory?: (accessory: PlatformAccessory) => () => void;
18
- prune?: boolean;
19
- }
20
- export type CompositeBinder = (platform: LoxonePlatform, handle: ControlHandle, client: LoxoneClient) => PlannedAccessory[];
21
- export declare const CONTROL_BINDERS: Readonly<Record<string, ControlBinder>>;
22
- export declare const COMPOSITE_BINDERS: Readonly<Record<string, CompositeBinder>>;
23
- export declare const MIGRATED_CONTROL_TYPES: ReadonlySet<string>;
24
- //# sourceMappingURL=ControlBinders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ControlBinders.d.ts","sourceRoot":"","sources":["../../src/binding/ControlBinders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAGV,aAAa,EAWb,YAAY,EAUb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAoBxD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;IAE/B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;CAC1C;AAOD,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,KAAK,cAAc,EAAE,CAAC;AAGlG,MAAM,WAAW,gBAAgB;IAE/B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;I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