homebridge-loxone-proxy 1.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.
Files changed (80) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +11 -0
  3. package/config.schema.json +77 -0
  4. package/dist/LoxoneAccessory.d.ts +10 -0
  5. package/dist/LoxoneAccessory.d.ts.map +1 -0
  6. package/dist/LoxoneAccessory.js +117 -0
  7. package/dist/LoxoneAccessory.js.map +1 -0
  8. package/dist/LoxonePlatform.d.ts +27 -0
  9. package/dist/LoxonePlatform.d.ts.map +1 -0
  10. package/dist/LoxonePlatform.js +139 -0
  11. package/dist/LoxonePlatform.js.map +1 -0
  12. package/dist/index.d.ts +4 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +6 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/items/Alarm.d.ts +28 -0
  17. package/dist/items/Alarm.d.ts.map +1 -0
  18. package/dist/items/Alarm.js +65 -0
  19. package/dist/items/Alarm.js.map +1 -0
  20. package/dist/items/Brightness.d.ts +17 -0
  21. package/dist/items/Brightness.d.ts.map +1 -0
  22. package/dist/items/Brightness.js +40 -0
  23. package/dist/items/Brightness.js.map +1 -0
  24. package/dist/items/Camera.d.ts +50 -0
  25. package/dist/items/Camera.d.ts.map +1 -0
  26. package/dist/items/Camera.js +150 -0
  27. package/dist/items/Camera.js.map +1 -0
  28. package/dist/items/Dimmer.d.ts +19 -0
  29. package/dist/items/Dimmer.d.ts.map +1 -0
  30. package/dist/items/Dimmer.js +59 -0
  31. package/dist/items/Dimmer.js.map +1 -0
  32. package/dist/items/Gate.d.ts +36 -0
  33. package/dist/items/Gate.d.ts.map +1 -0
  34. package/dist/items/Gate.js +107 -0
  35. package/dist/items/Gate.js.map +1 -0
  36. package/dist/items/Humidity.d.ts +17 -0
  37. package/dist/items/Humidity.d.ts.map +1 -0
  38. package/dist/items/Humidity.js +40 -0
  39. package/dist/items/Humidity.js.map +1 -0
  40. package/dist/items/IRoomControllerV2.d.ts +48 -0
  41. package/dist/items/IRoomControllerV2.d.ts.map +1 -0
  42. package/dist/items/IRoomControllerV2.js +125 -0
  43. package/dist/items/IRoomControllerV2.js.map +1 -0
  44. package/dist/items/IntercomV2.d.ts +17 -0
  45. package/dist/items/IntercomV2.d.ts.map +1 -0
  46. package/dist/items/IntercomV2.js +50 -0
  47. package/dist/items/IntercomV2.js.map +1 -0
  48. package/dist/items/Lock.d.ts +28 -0
  49. package/dist/items/Lock.d.ts.map +1 -0
  50. package/dist/items/Lock.js +71 -0
  51. package/dist/items/Lock.js.map +1 -0
  52. package/dist/items/MoodSwitch.d.ts +15 -0
  53. package/dist/items/MoodSwitch.d.ts.map +1 -0
  54. package/dist/items/MoodSwitch.js +48 -0
  55. package/dist/items/MoodSwitch.js.map +1 -0
  56. package/dist/items/Motion.d.ts +20 -0
  57. package/dist/items/Motion.d.ts.map +1 -0
  58. package/dist/items/Motion.js +44 -0
  59. package/dist/items/Motion.js.map +1 -0
  60. package/dist/items/PresenceDetector.d.ts +20 -0
  61. package/dist/items/PresenceDetector.d.ts.map +1 -0
  62. package/dist/items/PresenceDetector.js +44 -0
  63. package/dist/items/PresenceDetector.js.map +1 -0
  64. package/dist/items/Switch.d.ts +18 -0
  65. package/dist/items/Switch.d.ts.map +1 -0
  66. package/dist/items/Switch.js +46 -0
  67. package/dist/items/Switch.js.map +1 -0
  68. package/dist/items/Ventilation.d.ts +32 -0
  69. package/dist/items/Ventilation.d.ts.map +1 -0
  70. package/dist/items/Ventilation.js +73 -0
  71. package/dist/items/Ventilation.js.map +1 -0
  72. package/dist/lib/IntercomStreamer.d.ts +26 -0
  73. package/dist/lib/IntercomStreamer.d.ts.map +1 -0
  74. package/dist/lib/IntercomStreamer.js +193 -0
  75. package/dist/lib/IntercomStreamer.js.map +1 -0
  76. package/dist/lib/LoxoneHandler.d.ts +4 -0
  77. package/dist/lib/LoxoneHandler.d.ts.map +1 -0
  78. package/dist/lib/LoxoneHandler.js +166 -0
  79. package/dist/lib/LoxoneHandler.js.map +1 -0
  80. package/package.json +62 -0
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Alarm = void 0;
4
+ class Alarm {
5
+ constructor(platform, accessory) {
6
+ this.platform = platform;
7
+ this.accessory = accessory;
8
+ this.State = {
9
+ SecuritySystemCurrentState: 3,
10
+ SecuritySystemTargetState: 3,
11
+ };
12
+ // Register a listener to be notified of changes in this items value
13
+ this.LoxoneListener = () => {
14
+ this.platform.log.debug(`[${this.device.name}] Register Listener for Switch`);
15
+ this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.armed, this.callBack.bind(this));
16
+ };
17
+ this.callBack = (message) => {
18
+ if (message.uuid) {
19
+ this.platform.log.debug(`[${this.device.name}] Callback state update for Alarm: ${message.value}`);
20
+ this.State.SecuritySystemTargetState = message.value;
21
+ this.State.SecuritySystemCurrentState = message.value;
22
+ //also make sure this change is directly communicated to HomeKit
23
+ this.service
24
+ .getCharacteristic(this.platform.Characteristic.SecuritySystemTargetState)
25
+ .updateValue(this.State.SecuritySystemTargetState);
26
+ this.service
27
+ .getCharacteristic(this.platform.Characteristic.SecuritySystemCurrentState)
28
+ .updateValue(this.State.SecuritySystemCurrentState);
29
+ }
30
+ };
31
+ this.service =
32
+ this.accessory.getService(this.platform.Service.SecuritySystem) ||
33
+ this.accessory.addService(this.platform.Service.SecuritySystem);
34
+ this.device = this.accessory.context.device;
35
+ this.LoxoneListener();
36
+ // create handlers for required characteristics
37
+ this.service.getCharacteristic(this.platform.Characteristic.SecuritySystemCurrentState)
38
+ .onGet(this.handleSecuritySystemCurrentStateGet.bind(this));
39
+ this.service.getCharacteristic(this.platform.Characteristic.SecuritySystemTargetState)
40
+ .onGet(this.handleSecuritySystemTargetStateGet.bind(this))
41
+ .onSet(this.handleSecuritySystemTargetStateSet.bind(this));
42
+ }
43
+ /**
44
+ * Handle requests to get the current value of the "Security System Current State" characteristic
45
+ */
46
+ handleSecuritySystemCurrentStateGet() {
47
+ this.platform.log.debug('Triggered GET SecuritySystemCurrentState');
48
+ return this.State.SecuritySystemCurrentState;
49
+ }
50
+ /**
51
+ * Handle requests to get the current value of the "Security System Target State" characteristic
52
+ */
53
+ handleSecuritySystemTargetStateGet() {
54
+ this.platform.log.debug('Triggered GET SecuritySystemTargetState');
55
+ return this.State.SecuritySystemTargetState;
56
+ }
57
+ /**
58
+ * Handle requests to set the "Security System Target State" characteristic
59
+ */
60
+ handleSecuritySystemTargetStateSet(value) {
61
+ this.platform.log.debug('Triggered SET SecuritySystemTargetState:' + value);
62
+ }
63
+ }
64
+ exports.Alarm = Alarm;
65
+ //# sourceMappingURL=Alarm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alarm.js","sourceRoot":"","sources":["../../src/items/Alarm.ts"],"names":[],"mappings":";;;AAIA,MAAa,KAAK;IAShB,YACmB,QAAwB,EACxB,SAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QAPvC,UAAK,GAAG;YACd,0BAA0B,EAAE,CAAC;YAC7B,yBAAyB,EAAE,CAAC;SAC7B,CAAC;QAuBF,oEAAoE;QACpE,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,gCAAgC,CAAC,CAAC;YAC9E,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1G,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAE,OAAsC,EAAG,EAAE;YACtD,IAAI,OAAO,CAAC,IAAI,EAAE;gBAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAA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,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACzD,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IA0BD;;OAEG;IACH,mCAAmC;QACjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC;IAC/C,CAAC;IAGD;;OAEG;IACH,kCAAkC;QAChC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,kCAAkC,CAAC,KAAK;QACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,GAAE,KAAK,CAAC,CAAC;IAC7E,CAAC;CAEF;AA9ED,sBA8EC"}
@@ -0,0 +1,17 @@
1
+ import { PlatformAccessory } from 'homebridge';
2
+ import { LoxonePlatform } from '../LoxonePlatform';
3
+ export declare class Brightness {
4
+ private readonly platform;
5
+ private readonly accessory;
6
+ private service;
7
+ private device;
8
+ private State;
9
+ constructor(platform: LoxonePlatform, accessory: PlatformAccessory);
10
+ LoxoneListener: () => void;
11
+ callBack: (message: {
12
+ uuid: string;
13
+ value: number;
14
+ }) => void;
15
+ handleCurrentAmbientLightLevelGet(): number;
16
+ }
17
+ //# sourceMappingURL=Brightness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Brightness.d.ts","sourceRoot":"","sources":["../../src/items/Brightness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,UAAU;IASnB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAT5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,KAAK,CAEX;gBAGiB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAgB/C,cAAc,aAIZ;IAEF,QAAQ,YAAc;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,UAUjD;IAEF,iCAAiC;CAIlC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Brightness = void 0;
4
+ class Brightness {
5
+ constructor(platform, accessory) {
6
+ this.platform = platform;
7
+ this.accessory = accessory;
8
+ this.State = {
9
+ CurrentAmbientLightLevel: 0,
10
+ };
11
+ // Register a listener to be notified of changes in this items value
12
+ this.LoxoneListener = () => {
13
+ this.platform.log.debug(`[${this.device.name}] Register Listener for Light Sensor`);
14
+ this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.value, this.callBack.bind(this));
15
+ };
16
+ this.callBack = (message) => {
17
+ if (message.uuid) {
18
+ this.platform.log.debug(`[${this.device.name}] Callback state update for Light Sensor: ${message.value}`);
19
+ this.State.CurrentAmbientLightLevel = (message.value > 0.0001) ? message.value : 0.0001;
20
+ //also make sure this change is directly communicated to HomeKit
21
+ this.service
22
+ .getCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel)
23
+ .updateValue(this.State.CurrentAmbientLightLevel);
24
+ }
25
+ };
26
+ this.service =
27
+ this.accessory.getService(this.platform.Service.LightSensor) ||
28
+ this.accessory.addService(this.platform.Service.LightSensor);
29
+ this.device = this.accessory.context.device;
30
+ this.LoxoneListener();
31
+ this.service.getCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel)
32
+ .onGet(this.handleCurrentAmbientLightLevelGet.bind(this)); // GET - bind to the `getOn` method below
33
+ }
34
+ handleCurrentAmbientLightLevelGet() {
35
+ this.platform.log.debug('Triggered GET CurrentAmbientLightLevel;');
36
+ return this.State.CurrentAmbientLightLevel;
37
+ }
38
+ }
39
+ exports.Brightness = Brightness;
40
+ //# sourceMappingURL=Brightness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Brightness.js","sourceRoot":"","sources":["../../src/items/Brightness.ts"],"names":[],"mappings":";;;AAIA,MAAa,UAAU;IAQrB,YACmB,QAAwB,EACxB,SAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QANvC,UAAK,GAAG;YACd,wBAAwB,EAAE,CAAC;SAC5B,CAAC;QAmBF,oEAAoE;QACpE,mBAAc,GAAG,GAAG,EAAE;YAEpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,sCAAsC,CAAC,CAAC;YACpF,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1G,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAE,OAAsC,EAAG,EAAE;YACtD,IAAI,OAAO,CAAC,IAAI,EAAE;gBAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,6CAA6C,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC1G,IAAI,CAAC,KAAK,CAAC,wBAAwB,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;gBAExF,gEAAgE;gBAChE,IAAI,CAAC,OAAO;qBACT,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC;qBACxE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;aACrD;QACH,CAAC,CAAC;QA7BA,IAAI,CAAC,OAAO;YACV,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;gBAC5D,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAE/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC;QAE5C,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC;aAClF,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,yCAAyC;IACxG,CAAC;IAqBD,iCAAiC;QAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC;IAC7C,CAAC;CACF;AAhDD,gCAgDC"}
@@ -0,0 +1,50 @@
1
+ import { PlatformAccessory } from 'homebridge';
2
+ import { LoxonePlatform } from '../LoxonePlatform';
3
+ export declare class Camera {
4
+ private readonly platform;
5
+ private readonly accessory;
6
+ private readonly ip;
7
+ private CameraOperatingMode;
8
+ private CameraRTPStreamManagement;
9
+ private DataStreamManagement;
10
+ private CameraRecordingManagement;
11
+ constructor(platform: LoxonePlatform, accessory: PlatformAccessory, ip: string);
12
+ handleActive(): number;
13
+ /**
14
+ * Handle requests to get the current value of the "Event Snapshots Active" characteristic
15
+ */
16
+ handleEventSnapshotsActiveGet(): number;
17
+ /**
18
+ * Handle requests to set the "Event Snapshots Active" characteristic
19
+ */
20
+ handleEventSnapshotsActiveSet(value: any): void;
21
+ /**
22
+ * Handle requests to get the current value of the "Periodic Snapshots Active" characteristic
23
+ */
24
+ handlePeriodicSnapshotsActiveGet(): number;
25
+ /**
26
+ * Handle requests to set the "Periodic Snapshots Active" characteristic
27
+ */
28
+ handlePeriodicSnapshotsActiveSet(value: any): void;
29
+ /**
30
+ * Handle requests to get the current value of the "HomeKit Camera Active" characteristic
31
+ */
32
+ handleHomeKitCameraActiveGet(): number;
33
+ /**
34
+ * Handle requests to set the "HomeKit Camera Active" characteristic
35
+ */
36
+ handleHomeKitCameraActiveSet(value: any): void;
37
+ /**
38
+ * Handle requests to get the current value of the "Version" characteristic
39
+ */
40
+ handleVersionGet(): number;
41
+ /**
42
+ * Handle requests to get the current value of the "Active" characteristic
43
+ */
44
+ handleActiveGet(): number;
45
+ /**
46
+ * Handle requests to set the "Active" characteristic
47
+ */
48
+ handleActiveSet(value: any): void;
49
+ }
50
+ //# sourceMappingURL=Camera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../src/items/Camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAoC,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,MAAM;IAQf,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,EAAE;IATrB,OAAO,CAAC,mBAAmB,CAAU;IACrC,OAAO,CAAC,yBAAyB,CAAU;IAC3C,OAAO,CAAC,oBAAoB,CAAU;IACtC,OAAO,CAAC,yBAAyB,CAAU;gBAIxB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB,EAC5B,EAAE,EAAE,MAAM;IAqF7B,YAAY;IAIZ;;OAEG;IACH,6BAA6B;IAS7B;;OAEG;IACH,6BAA6B,CAAC,KAAK,KAAA;IAInC;;OAEG;IACH,gCAAgC;IAMhC;;OAEG;IACH,gCAAgC,CAAC,KAAK,KAAA;IAItC;;OAEG;IACH,4BAA4B;IAQ5B;;OAEG;IACH,4BAA4B,CAAC,KAAK,KAAA;IAIlC;;OAEG;IACH,gBAAgB;IAMhB;;OAEG;IACH,eAAe;IASf;;OAEG;IACH,eAAe,CAAC,KAAK,KAAA;CAGtB"}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Camera = void 0;
4
+ const IntercomStreamer_1 = require("../lib/IntercomStreamer");
5
+ class Camera {
6
+ //private device: Control;
7
+ constructor(platform, accessory, ip) {
8
+ this.platform = platform;
9
+ this.accessory = accessory;
10
+ this.ip = ip;
11
+ this.CameraOperatingMode =
12
+ this.accessory.getService(this.platform.Service.CameraOperatingMode) ||
13
+ this.accessory.addService(this.platform.Service.CameraOperatingMode);
14
+ this.CameraOperatingMode.getCharacteristic(this.platform.Characteristic.EventSnapshotsActive)
15
+ .onGet(this.handleEventSnapshotsActiveGet.bind(this))
16
+ .onSet(this.handleEventSnapshotsActiveSet.bind(this));
17
+ this.CameraOperatingMode.getCharacteristic(this.platform.Characteristic.PeriodicSnapshotsActive)
18
+ .onGet(this.handlePeriodicSnapshotsActiveGet.bind(this))
19
+ .onSet(this.handlePeriodicSnapshotsActiveSet.bind(this));
20
+ this.CameraOperatingMode.getCharacteristic(this.platform.Characteristic.HomeKitCameraActive)
21
+ .onGet(this.handleHomeKitCameraActiveGet.bind(this))
22
+ .onSet(this.handleHomeKitCameraActiveSet.bind(this));
23
+ this.CameraRTPStreamManagement =
24
+ this.accessory.getService(this.platform.Service.CameraRTPStreamManagement) ||
25
+ this.accessory.addService(this.platform.Service.CameraRTPStreamManagement);
26
+ this.CameraRTPStreamManagement.getCharacteristic(this.platform.Characteristic.Active)
27
+ .onGet(this.handleActive.bind(this));
28
+ this.DataStreamManagement =
29
+ this.accessory.getService(this.platform.Service.DataStreamTransportManagement) ||
30
+ this.accessory.addService(this.platform.Service.DataStreamTransportManagement);
31
+ this.DataStreamManagement.getCharacteristic(this.platform.Characteristic.Version)
32
+ .onGet(this.handleVersionGet.bind(this));
33
+ this.CameraRecordingManagement =
34
+ this.accessory.getService(this.platform.Service.CameraRecordingManagement) ||
35
+ this.accessory.addService(this.platform.Service.CameraRecordingManagement);
36
+ this.CameraRecordingManagement.getCharacteristic(this.platform.Characteristic.Active)
37
+ .onGet(this.handleActiveGet.bind(this))
38
+ .onSet(this.handleActiveSet.bind(this));
39
+ const streamingDelegate = new IntercomStreamer_1.IntercomStreamer(this.platform, this.platform.api.hap, ip);
40
+ const options = {
41
+ cameraStreamCount: 5,
42
+ delegate: streamingDelegate,
43
+ streamingOptions: {
44
+ srtp: true,
45
+ // eslint-disable-next-line max-len
46
+ supportedCryptoSuites: [0 /* AES_CM_128_HMAC_SHA1_80 */],
47
+ video: {
48
+ codec: {
49
+ profiles: [
50
+ 0 /* BASELINE */,
51
+ 1 /* MAIN */,
52
+ 2 /* HIGH */,
53
+ ],
54
+ levels: [
55
+ 0 /* LEVEL3_1 */,
56
+ 1 /* LEVEL3_2 */,
57
+ 2 /* LEVEL4_0 */,
58
+ ],
59
+ },
60
+ resolutions: [
61
+ [1280, 720, 30],
62
+ [1024, 768, 30],
63
+ [640, 480, 30],
64
+ [640, 360, 30],
65
+ [480, 360, 30],
66
+ [480, 270, 30],
67
+ [320, 240, 30],
68
+ [320, 240, 15],
69
+ [320, 180, 30],
70
+ ],
71
+ },
72
+ },
73
+ };
74
+ const cameraController = new this.platform.api.hap.CameraController(options);
75
+ streamingDelegate.controller = cameraController;
76
+ this.accessory.configureController(cameraController);
77
+ }
78
+ handleActive() {
79
+ return 1;
80
+ }
81
+ /**
82
+ * Handle requests to get the current value of the "Event Snapshots Active" characteristic
83
+ */
84
+ handleEventSnapshotsActiveGet() {
85
+ this.platform.log.debug('Triggered GET EventSnapshotsActive');
86
+ // set this to a valid value for EventSnapshotsActive
87
+ const currentValue = this.platform.Characteristic.EventSnapshotsActive.DISABLE;
88
+ return currentValue;
89
+ }
90
+ /**
91
+ * Handle requests to set the "Event Snapshots Active" characteristic
92
+ */
93
+ handleEventSnapshotsActiveSet(value) {
94
+ this.platform.log.debug('Triggered SET EventSnapshotsActive:' + value);
95
+ }
96
+ /**
97
+ * Handle requests to get the current value of the "Periodic Snapshots Active" characteristic
98
+ */
99
+ handlePeriodicSnapshotsActiveGet() {
100
+ this.platform.log.debug('Triggered GET PeriodicSnapshotsActive');
101
+ const currentValue = this.platform.Characteristic.PeriodicSnapshotsActive.DISABLE;
102
+ return currentValue;
103
+ }
104
+ /**
105
+ * Handle requests to set the "Periodic Snapshots Active" characteristic
106
+ */
107
+ handlePeriodicSnapshotsActiveSet(value) {
108
+ this.platform.log.debug('Triggered SET PeriodicSnapshotsActive:' + value);
109
+ }
110
+ /**
111
+ * Handle requests to get the current value of the "HomeKit Camera Active" characteristic
112
+ */
113
+ handleHomeKitCameraActiveGet() {
114
+ this.platform.log.debug('Triggered GET HomeKitCameraActive');
115
+ // set this to a valid value for HomeKitCameraActive
116
+ const currentValue = this.platform.Characteristic.HomeKitCameraActive.OFF;
117
+ return currentValue;
118
+ }
119
+ /**
120
+ * Handle requests to set the "HomeKit Camera Active" characteristic
121
+ */
122
+ handleHomeKitCameraActiveSet(value) {
123
+ this.platform.log.debug('Triggered SET HomeKitCameraActive:' + value);
124
+ }
125
+ /**
126
+ * Handle requests to get the current value of the "Version" characteristic
127
+ */
128
+ handleVersionGet() {
129
+ this.platform.log.debug('Triggered GET Version');
130
+ const currentValue = 1;
131
+ return currentValue;
132
+ }
133
+ /**
134
+ * Handle requests to get the current value of the "Active" characteristic
135
+ */
136
+ handleActiveGet() {
137
+ this.platform.log.debug('Triggered GET Active');
138
+ // set this to a valid value for Active
139
+ const currentValue = this.platform.Characteristic.Active.INACTIVE;
140
+ return currentValue;
141
+ }
142
+ /**
143
+ * Handle requests to set the "Active" characteristic
144
+ */
145
+ handleActiveSet(value) {
146
+ this.platform.log.debug('Triggered SET Active:' + value);
147
+ }
148
+ }
149
+ exports.Camera = Camera;
150
+ //# sourceMappingURL=Camera.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Camera.js","sourceRoot":"","sources":["../../src/items/Camera.ts"],"names":[],"mappings":";;;AAEA,8DAA2D;AAE3D,MAAa,MAAM;IAKjB,0BAA0B;IAE1B,YACmB,QAAwB,EACxB,SAA4B,EAC5B,EAAU;QAFV,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QAC5B,OAAE,GAAF,EAAE,CAAQ;QAG3B,IAAI,CAAC,mBAAmB;YACtB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC;gBACpE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAEvE,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,oBAAoB,CAAC;aAC1F,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACpD,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAExD,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,uBAAuB,CAAC;aAC7F,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvD,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAE3D,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC;aACzF,KA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KAAK,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACjD,MAAM,YAAY,GAAG,CAAC,CAAC;QACvB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,eAAe;QACb,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAEhD,uCAAuC;QACvC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC;QAElE,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,KAAK;QACnB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;IAC3D,CAAC;CACF;AAnLD,wBAmLC"}
@@ -0,0 +1,19 @@
1
+ import { PlatformAccessory, CharacteristicValue } from 'homebridge';
2
+ import { LoxonePlatform } from '../LoxonePlatform';
3
+ export declare class Dimmer {
4
+ private readonly platform;
5
+ private readonly accessory;
6
+ private service;
7
+ private device;
8
+ private State;
9
+ constructor(platform: LoxonePlatform, accessory: PlatformAccessory);
10
+ LoxoneListener: () => void;
11
+ callBack: (message: {
12
+ uuid: string;
13
+ value: number;
14
+ }) => void;
15
+ setOn(value: CharacteristicValue): Promise<void>;
16
+ getOn(): Promise<CharacteristicValue>;
17
+ setBrightness(value: CharacteristicValue): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=Dimmer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dimmer.d.ts","sourceRoot":"","sources":["../../src/items/Dimmer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,MAAM;IAUf,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAV5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,KAAK,CAGX;gBAGiB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAiB/C,cAAc,aAGZ;IAEF,QAAQ,YAAc;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,UAcjD;IAEI,KAAK,CAAC,KAAK,EAAE,mBAAmB;IAShC,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAMrC,aAAa,CAAC,KAAK,EAAE,mBAAmB;CAK/C"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Dimmer = void 0;
4
+ class Dimmer {
5
+ constructor(platform, accessory) {
6
+ this.platform = platform;
7
+ this.accessory = accessory;
8
+ this.State = {
9
+ On: false,
10
+ Brightness: 0,
11
+ };
12
+ // Register a listener to be notified of changes in this items value
13
+ this.LoxoneListener = () => {
14
+ this.platform.log.debug(`[${this.device.name}] Register Listener for Dimmer`);
15
+ this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.position, this.callBack.bind(this));
16
+ };
17
+ this.callBack = (message) => {
18
+ if (message.uuid) {
19
+ this.platform.log.debug(`[${this.device.name}] Callback state update for Dimmer: ${message.value}`);
20
+ this.State.On = !!message.value;
21
+ this.State.Brightness = message.value;
22
+ //also make sure this change is directly communicated to HomeKit
23
+ this.service
24
+ .getCharacteristic(this.platform.Characteristic.On)
25
+ .updateValue(this.State.On);
26
+ this.service
27
+ .getCharacteristic(this.platform.Characteristic.Brightness)
28
+ .updateValue(this.State.Brightness);
29
+ }
30
+ };
31
+ this.service = this.accessory.getService(this.platform.Service.Lightbulb) || this.accessory.addService(this.platform.Service.Lightbulb);
32
+ this.device = this.accessory.context.device;
33
+ this.LoxoneListener();
34
+ this.service.getCharacteristic(this.platform.Characteristic.On)
35
+ .onSet(this.setOn.bind(this)) // SET - bind to the `setOn` method below
36
+ .onGet(this.getOn.bind(this)); // GET - bind to the `getOn` method below
37
+ this.service.getCharacteristic(this.platform.Characteristic.Brightness)
38
+ .onSet(this.setBrightness.bind(this)); // SET - bind to the 'setBrightness` method below
39
+ }
40
+ async setOn(value) {
41
+ this.State.On = value;
42
+ this.platform.log.debug('Set Characteristic On ->', value);
43
+ const command = this.State.On ? 'On' : 'Off';
44
+ this.platform.log.debug(`[${this.device.name}] - send message: ${command}`);
45
+ this.platform.LoxoneHandler.sendCommand(this.device.uuidAction, command);
46
+ }
47
+ async getOn() {
48
+ const isOn = this.State.On;
49
+ this.platform.log.debug('Get Characteristic On ->', isOn);
50
+ return isOn;
51
+ }
52
+ async setBrightness(value) {
53
+ this.State.Brightness = value;
54
+ this.platform.log.debug(`[${this.device.name}] - send message: ${this.State.Brightness}`);
55
+ this.platform.LoxoneHandler.sendCommand(this.device.uuidAction, this.State.Brightness);
56
+ }
57
+ }
58
+ exports.Dimmer = Dimmer;
59
+ //# sourceMappingURL=Dimmer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dimmer.js","sourceRoot":"","sources":["../../src/items/Dimmer.ts"],"names":[],"mappings":";;;AAIA,MAAa,MAAM;IASjB,YACmB,QAAwB,EACxB,SAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QAPvC,UAAK,GAAG;YACd,EAAE,EAAE,KAAK;YACT,UAAU,EAAE,CAAC;SACd,CAAC;QAoBF,oEAAoE;QACpE,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,gCAAgC,CAAC,CAAC;YAC9E,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,uB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CAAC,KAAK,CAAC,UAAU,GAAG,KAAe,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,qBAAqB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QAC1F,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACzF,CAAC;CACF;AArED,wBAqEC"}
@@ -0,0 +1,36 @@
1
+ import { PlatformAccessory } from 'homebridge';
2
+ import { LoxonePlatform } from '../LoxonePlatform';
3
+ export declare class Gate {
4
+ private readonly platform;
5
+ private readonly accessory;
6
+ private service;
7
+ private device;
8
+ private State;
9
+ constructor(platform: LoxonePlatform, accessory: PlatformAccessory);
10
+ LoxoneListener: () => void;
11
+ PositionCallBack: (message: {
12
+ uuid: string;
13
+ value: number;
14
+ }) => void;
15
+ ActiveCallBack: (message: {
16
+ uuid: string;
17
+ value: number;
18
+ }) => void;
19
+ /**
20
+ * Handle requests to get the current value of the "Current Door State" characteristic
21
+ */
22
+ handleCurrentDoorStateGet(): number;
23
+ /**
24
+ * Handle requests to get the current value of the "Target Door State" characteristic
25
+ */
26
+ handleTargetDoorStateGet(): number;
27
+ /**
28
+ * Handle requests to set the "Target Door State" characteristic
29
+ */
30
+ handleTargetDoorStateSet(value: any): void;
31
+ /**
32
+ * Handle requests to get the current value of the "Obstruction Detected" characteristic
33
+ */
34
+ handleObstructionDetectedGet(): number;
35
+ }
36
+ //# sourceMappingURL=Gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gate.d.ts","sourceRoot":"","sources":["../../src/items/Gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,IAAI;IAYb,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAZ5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,KAAK,CAKX;gBAGiB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAuB/C,cAAc,aAIZ;IAEF,gBAAgB,YAAa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,UAkB1D;IAEF,cAAc,YAAa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,UA2BxD;IAEF;;OAEG;IACH,yBAAyB;IAKzB;;OAEG;IACH,wBAAwB;IAKxB;;OAEG;IACH,wBAAwB,CAAC,KAAK,KAAA;IAI9B;;OAEG;IACH,4BAA4B;CAI7B"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Gate = void 0;
4
+ class Gate {
5
+ constructor(platform, accessory) {
6
+ this.platform = platform;
7
+ this.accessory = accessory;
8
+ this.State = {
9
+ CurrentDoorState: 0,
10
+ TargetDoorState: 0,
11
+ Position: 0,
12
+ ObstructionDetected: 0,
13
+ };
14
+ // Register a listener to be notified of changes in this items value
15
+ this.LoxoneListener = () => {
16
+ this.platform.log.debug(`[${this.device.name}] Register Listener for Switch`);
17
+ this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.position, this.PositionCallBack.bind(this));
18
+ this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.active, this.ActiveCallBack.bind(this));
19
+ };
20
+ this.PositionCallBack = (message) => {
21
+ if (message.uuid) {
22
+ this.platform.log.debug(`[${this.device.name}] Position Callback state update for Gate: ${message.value}`);
23
+ if (message.value === 0) {
24
+ this.State.TargetDoorState = 1;
25
+ }
26
+ if (message.value === 1) {
27
+ this.State.TargetDoorState = 0;
28
+ }
29
+ this.State.Position = message.value;
30
+ //also make sure this change is directly communicated to HomeKit
31
+ this.service
32
+ .getCharacteristic(this.platform.Characteristic.TargetDoorState)
33
+ .updateValue(this.State.TargetDoorState);
34
+ }
35
+ };
36
+ this.ActiveCallBack = (message) => {
37
+ if (message.uuid) {
38
+ this.platform.log.debug(`[${this.device.name}] Active Callback state update for Gate: ${message.value}`);
39
+ switch (message.value) {
40
+ case -1: // closing
41
+ this.State.CurrentDoorState = 3;
42
+ break;
43
+ case 0: // not moving
44
+ if (this.State.Position === 0) {
45
+ this.State.CurrentDoorState = 1; // open
46
+ }
47
+ else if (this.State.Position === 1) {
48
+ this.State.CurrentDoorState = 0; // closed
49
+ }
50
+ else {
51
+ this.State.CurrentDoorState = 4; // stopped
52
+ }
53
+ break;
54
+ case 1: // opening
55
+ this.State.CurrentDoorState = 2;
56
+ break;
57
+ }
58
+ //also make sure this change is directly communicated to HomeKit
59
+ this.service
60
+ .getCharacteristic(this.platform.Characteristic.CurrentDoorState)
61
+ .updateValue(this.State.CurrentDoorState);
62
+ }
63
+ };
64
+ this.service =
65
+ this.accessory.getService(this.platform.Service.GarageDoorOpener) ||
66
+ this.accessory.addService(this.platform.Service.GarageDoorOpener);
67
+ this.device = this.accessory.context.device;
68
+ this.LoxoneListener();
69
+ // create handlers for required characteristics
70
+ this.service.getCharacteristic(this.platform.Characteristic.CurrentDoorState)
71
+ .onGet(this.handleCurrentDoorStateGet.bind(this));
72
+ this.service.getCharacteristic(this.platform.Characteristic.TargetDoorState)
73
+ .onGet(this.handleTargetDoorStateGet.bind(this))
74
+ .onSet(this.handleTargetDoorStateSet.bind(this));
75
+ this.service.getCharacteristic(this.platform.Characteristic.ObstructionDetected)
76
+ .onGet(this.handleObstructionDetectedGet.bind(this));
77
+ }
78
+ /**
79
+ * Handle requests to get the current value of the "Current Door State" characteristic
80
+ */
81
+ handleCurrentDoorStateGet() {
82
+ this.platform.log.debug('Triggered GET CurrentDoorState');
83
+ return this.State.CurrentDoorState;
84
+ }
85
+ /**
86
+ * Handle requests to get the current value of the "Target Door State" characteristic
87
+ */
88
+ handleTargetDoorStateGet() {
89
+ this.platform.log.debug('Triggered GET TargetDoorState');
90
+ return this.State.TargetDoorState;
91
+ }
92
+ /**
93
+ * Handle requests to set the "Target Door State" characteristic
94
+ */
95
+ handleTargetDoorStateSet(value) {
96
+ this.platform.log.debug('Triggered SET TargetDoorState:' + value);
97
+ }
98
+ /**
99
+ * Handle requests to get the current value of the "Obstruction Detected" characteristic
100
+ */
101
+ handleObstructionDetectedGet() {
102
+ this.platform.log.debug('Triggered GET ObstructionDetected');
103
+ return this.State.ObstructionDetected;
104
+ }
105
+ }
106
+ exports.Gate = Gate;
107
+ //# sourceMappingURL=Gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gate.js","sourceRoot":"","sources":["../../src/items/Gate.ts"],"names":[],"mappings":";;;AAIA,MAAa,IAAI;IAWf,YACmB,QAAwB,EACxB,SAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QATvC,UAAK,GAAG;YACd,gBAAgB,EAAE,CAAC;YACnB,eAAe,EAAE,CAAC;YAClB,QAAQ,EAAE,CAAC;YACX,mBAAmB,EAAE,CAAC;SACvB,CAAC;QA0BF,oEAAoE;QACpE,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,gCAAgC,CAAC,CAAC;YAC9E,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACnH,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,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AAC,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC;aACzE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC/C,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAEnD,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC;aAC7E,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACzD,CAAC;IA0DD;;OAEG;IACH,yBAAyB;QACvB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,wBAAwB;QACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,wBAAwB,CAAC,KAAK;QAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,gCAAgC,GAAG,KAAK,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,4BAA4B;QAC1B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC;IACxC,CAAC;CACF;AAzHD,oBAyHC"}
@@ -0,0 +1,17 @@
1
+ import { PlatformAccessory } from 'homebridge';
2
+ import { LoxonePlatform } from '../LoxonePlatform';
3
+ export declare class Humidiy {
4
+ private readonly platform;
5
+ private readonly accessory;
6
+ private service;
7
+ private device;
8
+ private State;
9
+ constructor(platform: LoxonePlatform, accessory: PlatformAccessory);
10
+ LoxoneListener: () => void;
11
+ callBack: (message: {
12
+ uuid: string;
13
+ value: number;
14
+ }) => void;
15
+ handleCurrentRelativeHumidityGet(): number;
16
+ }
17
+ //# sourceMappingURL=Humidity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Humidity.d.ts","sourceRoot":"","sources":["../../src/items/Humidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,OAAO;IAShB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAT5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,KAAK,CAEX;gBAGiB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAgB/C,cAAc,aAGZ;IAEF,QAAQ,YAAc;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,UAUjD;IAEF,gCAAgC;CAIjC"}