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.
- package/LICENSE +176 -0
- package/README.md +11 -0
- package/config.schema.json +77 -0
- package/dist/LoxoneAccessory.d.ts +10 -0
- package/dist/LoxoneAccessory.d.ts.map +1 -0
- package/dist/LoxoneAccessory.js +117 -0
- package/dist/LoxoneAccessory.js.map +1 -0
- package/dist/LoxonePlatform.d.ts +27 -0
- package/dist/LoxonePlatform.d.ts.map +1 -0
- package/dist/LoxonePlatform.js +139 -0
- package/dist/LoxonePlatform.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/items/Alarm.d.ts +28 -0
- package/dist/items/Alarm.d.ts.map +1 -0
- package/dist/items/Alarm.js +65 -0
- package/dist/items/Alarm.js.map +1 -0
- package/dist/items/Brightness.d.ts +17 -0
- package/dist/items/Brightness.d.ts.map +1 -0
- package/dist/items/Brightness.js +40 -0
- package/dist/items/Brightness.js.map +1 -0
- package/dist/items/Camera.d.ts +50 -0
- package/dist/items/Camera.d.ts.map +1 -0
- package/dist/items/Camera.js +150 -0
- package/dist/items/Camera.js.map +1 -0
- package/dist/items/Dimmer.d.ts +19 -0
- package/dist/items/Dimmer.d.ts.map +1 -0
- package/dist/items/Dimmer.js +59 -0
- package/dist/items/Dimmer.js.map +1 -0
- package/dist/items/Gate.d.ts +36 -0
- package/dist/items/Gate.d.ts.map +1 -0
- package/dist/items/Gate.js +107 -0
- package/dist/items/Gate.js.map +1 -0
- package/dist/items/Humidity.d.ts +17 -0
- package/dist/items/Humidity.d.ts.map +1 -0
- package/dist/items/Humidity.js +40 -0
- package/dist/items/Humidity.js.map +1 -0
- package/dist/items/IRoomControllerV2.d.ts +48 -0
- package/dist/items/IRoomControllerV2.d.ts.map +1 -0
- package/dist/items/IRoomControllerV2.js +125 -0
- package/dist/items/IRoomControllerV2.js.map +1 -0
- package/dist/items/IntercomV2.d.ts +17 -0
- package/dist/items/IntercomV2.d.ts.map +1 -0
- package/dist/items/IntercomV2.js +50 -0
- package/dist/items/IntercomV2.js.map +1 -0
- package/dist/items/Lock.d.ts +28 -0
- package/dist/items/Lock.d.ts.map +1 -0
- package/dist/items/Lock.js +71 -0
- package/dist/items/Lock.js.map +1 -0
- package/dist/items/MoodSwitch.d.ts +15 -0
- package/dist/items/MoodSwitch.d.ts.map +1 -0
- package/dist/items/MoodSwitch.js +48 -0
- package/dist/items/MoodSwitch.js.map +1 -0
- package/dist/items/Motion.d.ts +20 -0
- package/dist/items/Motion.d.ts.map +1 -0
- package/dist/items/Motion.js +44 -0
- package/dist/items/Motion.js.map +1 -0
- package/dist/items/PresenceDetector.d.ts +20 -0
- package/dist/items/PresenceDetector.d.ts.map +1 -0
- package/dist/items/PresenceDetector.js +44 -0
- package/dist/items/PresenceDetector.js.map +1 -0
- package/dist/items/Switch.d.ts +18 -0
- package/dist/items/Switch.d.ts.map +1 -0
- package/dist/items/Switch.js +46 -0
- package/dist/items/Switch.js.map +1 -0
- package/dist/items/Ventilation.d.ts +32 -0
- package/dist/items/Ventilation.d.ts.map +1 -0
- package/dist/items/Ventilation.js +73 -0
- package/dist/items/Ventilation.js.map +1 -0
- package/dist/lib/IntercomStreamer.d.ts +26 -0
- package/dist/lib/IntercomStreamer.d.ts.map +1 -0
- package/dist/lib/IntercomStreamer.js +193 -0
- package/dist/lib/IntercomStreamer.js.map +1 -0
- package/dist/lib/LoxoneHandler.d.ts +4 -0
- package/dist/lib/LoxoneHandler.d.ts.map +1 -0
- package/dist/lib/LoxoneHandler.js +166 -0
- package/dist/lib/LoxoneHandler.js.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginAlias": "LoxonePlatform",
|
|
3
|
+
"Name": "Homebridge-Loxone-Proxy",
|
|
4
|
+
"pluginType": "platform",
|
|
5
|
+
"singular": true,
|
|
6
|
+
"schema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"host": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "Loxone miniserver ip"
|
|
13
|
+
},
|
|
14
|
+
"port": {
|
|
15
|
+
"type": "integer",
|
|
16
|
+
"default": "80",
|
|
17
|
+
"required": true,
|
|
18
|
+
"description": "miniserver port"
|
|
19
|
+
},
|
|
20
|
+
"username": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"required": true,
|
|
23
|
+
"description": "Loxone username"
|
|
24
|
+
},
|
|
25
|
+
"password": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"required": true,
|
|
28
|
+
"description": "Loxone password"
|
|
29
|
+
},
|
|
30
|
+
"options": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"title": "Options",
|
|
33
|
+
"properties": {
|
|
34
|
+
"MoodSwitches": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"default": "1",
|
|
37
|
+
"enum": ["0","1"],
|
|
38
|
+
"description": "Include Lighting Controller Moods as Switches."
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"switchAlias": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"title": "Switch aliases",
|
|
45
|
+
"description": "Change the prefixes being used for the assumptions",
|
|
46
|
+
"properties": {
|
|
47
|
+
"Lock": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"InfoOnlyDigitalAlias": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"title": "InfoOnlyDigital aliases",
|
|
55
|
+
"description": "Change the prefixes being used for the assumptions",
|
|
56
|
+
"properties": {
|
|
57
|
+
"Motion": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"InfoOnlyAnalogAlias": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"title": "InfoOnlyAnalog aliases",
|
|
65
|
+
"description": "Change the prefixes being used for the assumptions",
|
|
66
|
+
"properties": {
|
|
67
|
+
"Humidity": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"Brightness": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LoxonePlatform } from './LoxonePlatform';
|
|
2
|
+
import { Control } from './structure/LoxAPP3';
|
|
3
|
+
export declare class LoxoneAccessory {
|
|
4
|
+
private readonly platform;
|
|
5
|
+
private readonly device;
|
|
6
|
+
private SupportedItems;
|
|
7
|
+
constructor(platform: LoxonePlatform, device: Control);
|
|
8
|
+
mapLoxoneItem(accessory: any): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=LoxoneAccessory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoxoneAccessory.d.ts","sourceRoot":"","sources":["../src/LoxoneAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAiB9C,qBAAa,eAAe;IAoBxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAlBzB,OAAO,CAAC,cAAc,CAcpB;gBAGiB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO;IAuClC,aAAa,CAAC,SAAS,KAAA;CAgExB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoxoneAccessory = void 0;
|
|
4
|
+
// Loxone Items
|
|
5
|
+
const Alarm_1 = require("./items/Alarm");
|
|
6
|
+
const Brightness_1 = require("./items/Brightness");
|
|
7
|
+
const Dimmer_1 = require("./items/Dimmer");
|
|
8
|
+
const Gate_1 = require("./items/Gate");
|
|
9
|
+
const Humidity_1 = require("./items/Humidity");
|
|
10
|
+
const IntercomV2_1 = require("./items/IntercomV2");
|
|
11
|
+
const IRoomControllerV2_1 = require("./items/IRoomControllerV2");
|
|
12
|
+
const Lock_1 = require("./items/Lock");
|
|
13
|
+
const MoodSwitch_1 = require("./items/MoodSwitch");
|
|
14
|
+
const Motion_1 = require("./items/Motion");
|
|
15
|
+
const PresenceDetector_1 = require("./items/PresenceDetector");
|
|
16
|
+
const Switch_1 = require("./items/Switch");
|
|
17
|
+
const Ventilation_1 = require("./items/Ventilation");
|
|
18
|
+
class LoxoneAccessory {
|
|
19
|
+
constructor(platform, device) {
|
|
20
|
+
this.platform = platform;
|
|
21
|
+
this.device = device;
|
|
22
|
+
// Items supported by this Plugin
|
|
23
|
+
this.SupportedItems = [
|
|
24
|
+
'Alarm',
|
|
25
|
+
'Brightness',
|
|
26
|
+
'Dimmer',
|
|
27
|
+
'Gate',
|
|
28
|
+
'Humidity',
|
|
29
|
+
'IntercomV2',
|
|
30
|
+
'IRoomControllerV2',
|
|
31
|
+
'Lock',
|
|
32
|
+
'MoodSwitch',
|
|
33
|
+
'Motion',
|
|
34
|
+
'PresenceDetector',
|
|
35
|
+
'Switch',
|
|
36
|
+
'Ventilation',
|
|
37
|
+
];
|
|
38
|
+
if (!(this.SupportedItems.includes(this.device.type))) {
|
|
39
|
+
this.platform.log.info(`[LoxoneAccesory] Skipping Unsupported item: ${this.device.name} with type ${this.device.type}`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const uuid = this.platform.api.hap.uuid.generate(this.device.uuidAction);
|
|
43
|
+
const existingAccessory = this.platform.accessories.find(accessory => accessory.UUID === uuid);
|
|
44
|
+
if (existingAccessory) {
|
|
45
|
+
// the accessory already exists
|
|
46
|
+
this.platform.log.info('[LoxoneAccesory] Item already mapped. Restoring accessory from cache:', existingAccessory.displayName);
|
|
47
|
+
// update the accessory.context
|
|
48
|
+
existingAccessory.context.device = this.device;
|
|
49
|
+
this.platform.api.updatePlatformAccessories([existingAccessory]);
|
|
50
|
+
// create the accessory handler for the restored accessory
|
|
51
|
+
this.mapLoxoneItem(existingAccessory);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// the accessory does not yet exist, so we need to create it
|
|
55
|
+
this.platform.log.info('[LoxoneAccesory] Adding new accessory:', this.device.name);
|
|
56
|
+
// create a new accessory
|
|
57
|
+
const accessory = new this.platform.api.platformAccessory(this.device.name, uuid);
|
|
58
|
+
// store a copy of the device object in the `accessory.context`
|
|
59
|
+
accessory.context.device = this.device;
|
|
60
|
+
// create the accessory handler for the newly create accessory
|
|
61
|
+
this.mapLoxoneItem(accessory);
|
|
62
|
+
// link the accessory to your platform
|
|
63
|
+
this.platform.api.registerPlatformAccessories('homebridge-loxone-proxy', 'LoxonePlatform', [accessory]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
mapLoxoneItem(accessory) {
|
|
67
|
+
// set accessory information
|
|
68
|
+
accessory.getService(this.platform.Service.AccessoryInformation)
|
|
69
|
+
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'Loxone')
|
|
70
|
+
.setCharacteristic(this.platform.Characteristic.Model, accessory.context.device.room)
|
|
71
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, accessory.context.device.uuidAction)
|
|
72
|
+
.setCharacteristic(this.platform.Characteristic.Name, accessory.context.device.name);
|
|
73
|
+
switch (accessory.context.device.type) {
|
|
74
|
+
case 'Alarm':
|
|
75
|
+
new Alarm_1.Alarm(this.platform, accessory);
|
|
76
|
+
break;
|
|
77
|
+
case 'Brightness':
|
|
78
|
+
new Brightness_1.Brightness(this.platform, accessory);
|
|
79
|
+
break;
|
|
80
|
+
case 'IntercomV2':
|
|
81
|
+
new IntercomV2_1.IntercomV2(this.platform, accessory);
|
|
82
|
+
break;
|
|
83
|
+
case 'Humidity':
|
|
84
|
+
new Humidity_1.Humidiy(this.platform, accessory);
|
|
85
|
+
break;
|
|
86
|
+
case 'Switch':
|
|
87
|
+
new Switch_1.Switch(this.platform, accessory);
|
|
88
|
+
break;
|
|
89
|
+
case 'Lock':
|
|
90
|
+
new Lock_1.Lock(this.platform, accessory);
|
|
91
|
+
break;
|
|
92
|
+
case 'Motion':
|
|
93
|
+
new Motion_1.Motion(this.platform, accessory);
|
|
94
|
+
break;
|
|
95
|
+
case 'PresenceDetector':
|
|
96
|
+
new PresenceDetector_1.PresenceDetector(this.platform, accessory);
|
|
97
|
+
break;
|
|
98
|
+
case 'Gate':
|
|
99
|
+
new Gate_1.Gate(this.platform, accessory);
|
|
100
|
+
break;
|
|
101
|
+
case 'Dimmer':
|
|
102
|
+
new Dimmer_1.Dimmer(this.platform, accessory);
|
|
103
|
+
break;
|
|
104
|
+
case 'MoodSwitch':
|
|
105
|
+
new MoodSwitch_1.MoodSwitch(this.platform, accessory);
|
|
106
|
+
break;
|
|
107
|
+
case 'IRoomControllerV2':
|
|
108
|
+
new IRoomControllerV2_1.IRoomControllerV2(this.platform, accessory);
|
|
109
|
+
break;
|
|
110
|
+
case 'Ventilation':
|
|
111
|
+
new Ventilation_1.Ventilation(this.platform, accessory);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.LoxoneAccessory = LoxoneAccessory;
|
|
117
|
+
//# sourceMappingURL=LoxoneAccessory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoxoneAccessory.js","sourceRoot":"","sources":["../src/LoxoneAccessory.ts"],"names":[],"mappings":";;;AAGA,eAAe;AACf,yCAAsC;AACtC,mDAAgD;AAChD,2CAAwC;AACxC,uCAAoC;AACpC,+CAA2C;AAC3C,mDAAgD;AAChD,iEAA8D;AAC9D,uCAAoC;AACpC,mDAAgD;AAChD,2CAAwC;AACxC,+DAA4D;AAC5D,2CAAwC;AACxC,qDAAkD;AAElD,MAAa,eAAe;IAmB1B,YACmB,QAAwB,EACxB,MAAe;QADf,aAAQ,GAAR,QAAQ,CAAgB;QACxB,WAAM,GAAN,MAAM,CAAS;QAnBlC,iCAAiC;QACzB,mBAAc,GAAG;YACvB,OAAO;YACP,YAAY;YACZ,QAAQ;YACR,MAAM;YACN,UAAU;YACV,YAAY;YACZ,mBAAmB;YACnB,MAAM;YACN,YAAY;YACZ,QAAQ;YACR,kBAAkB;YAClB,QAAQ;YACR,aAAa;SACd,CAAC;QAOA,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,Q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Q,EAAE,SAAS,CAAC,CAAC;gBACtC,MAAM;YAER,KAAK,QAAQ;gBACX,IAAI,eAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAER,KAAK,MAAM;gBACT,IAAI,WAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBACnC,MAAM;YAER,KAAK,QAAQ;gBACX,IAAI,eAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAER,KAAK,kBAAkB;gBACrB,IAAI,mCAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAC/C,MAAM;YAER,KAAK,MAAM;gBACT,IAAI,WAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBACnC,MAAM;YAER,KAAK,QAAQ;gBACX,IAAI,eAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAER,KAAK,YAAY;gBACf,IAAI,uBAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBACzC,MAAM;YAER,KAAK,mBAAmB;gBACtB,IAAI,qCAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAChD,MAAM;YAER,KAAK,aAAa;gBAChB,IAAI,yBAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAC1C,MAAM;SACT;IACH,CAAC;CACF;AA5HD,0CA4HC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic } from 'homebridge';
|
|
2
|
+
import { StructureFile, Controls, Control } from './structure/LoxAPP3';
|
|
3
|
+
export declare class LoxonePlatform implements DynamicPlatformPlugin {
|
|
4
|
+
readonly log: Logger;
|
|
5
|
+
readonly config: PlatformConfig;
|
|
6
|
+
readonly api: API;
|
|
7
|
+
private LoxoneRooms;
|
|
8
|
+
private LoxoneCats;
|
|
9
|
+
private LoxoneItems;
|
|
10
|
+
private LoxoneIntercomMotion;
|
|
11
|
+
LoxoneHandler: any;
|
|
12
|
+
readonly Service: typeof Service;
|
|
13
|
+
readonly Characteristic: typeof Characteristic;
|
|
14
|
+
readonly accessories: PlatformAccessory[];
|
|
15
|
+
constructor(log: Logger, config: PlatformConfig, api: API);
|
|
16
|
+
LoxoneInit(): Promise<void>;
|
|
17
|
+
parseLoxoneConfig(config: StructureFile): Promise<void>;
|
|
18
|
+
parseLoxoneLightController(LightControllerV2: Control): void;
|
|
19
|
+
checkLoxoneType(LoxoneItem: Control): string;
|
|
20
|
+
mapLoxoneItems(LoxoneItems: Controls): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* This function is invoked when homebridge restores cached accessories from disk at startup.
|
|
23
|
+
* It should be used to setup event handlers for characteristics and update respective values.
|
|
24
|
+
*/
|
|
25
|
+
configureAccessory(accessory: PlatformAccessory): void;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=LoxonePlatform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoxonePlatform.d.ts","sourceRoot":"","sources":["../src/LoxonePlatform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5H,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEvE,qBAAa,cAAe,YAAW,qBAAqB;aAcxC,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAd1B,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,oBAAoB,CAAM;IAG3B,aAAa,EAAE,GAAG,CAAC;IAC1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IACpF,SAAgB,WAAW,EAAE,iBAAiB,EAAE,CAAM;gBAGpC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAKpB,UAAU;IAcV,iBAAiB,CAAC,MAAM,EAAE,aAAa;IA6B7C,0BAA0B,CAAC,iBAAiB,EAAE,OAAO;IAiCrD,eAAe,CAAC,UAAU,EAAE,OAAO;IA6C7B,cAAc,CAAC,WAAW,EAAE,QAAQ;IAO1C;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;CAIhD"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LoxonePlatform = void 0;
|
|
7
|
+
const LoxoneHandler_1 = __importDefault(require("./lib/LoxoneHandler"));
|
|
8
|
+
const LoxoneAccessory_1 = require("./LoxoneAccessory");
|
|
9
|
+
class LoxonePlatform {
|
|
10
|
+
constructor(log, config, api) {
|
|
11
|
+
this.log = log;
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.api = api;
|
|
14
|
+
this.LoxoneRooms = {};
|
|
15
|
+
this.LoxoneCats = {};
|
|
16
|
+
this.LoxoneItems = {};
|
|
17
|
+
this.LoxoneIntercomMotion = '';
|
|
18
|
+
this.Service = this.api.hap.Service;
|
|
19
|
+
this.Characteristic = this.api.hap.Characteristic;
|
|
20
|
+
this.accessories = []; // this is used to track restored cached accessories
|
|
21
|
+
this.api.on('didFinishLaunching', () => this.LoxoneInit());
|
|
22
|
+
}
|
|
23
|
+
async LoxoneInit() {
|
|
24
|
+
this.log.info('Initializing Loxone Connection');
|
|
25
|
+
// New Miniserver websocket
|
|
26
|
+
this.LoxoneHandler = new LoxoneHandler_1.default(this);
|
|
27
|
+
// Wait for configfile. (LoxAPP3.json)
|
|
28
|
+
while (!this.LoxoneHandler.loxdata) {
|
|
29
|
+
await new Promise(resolve => setTimeout(resolve, 10000));
|
|
30
|
+
this.log.info(`[LoxoneInit] got structure file; last modified on ${this.LoxoneHandler.loxdata.lastModified}`);
|
|
31
|
+
this.parseLoxoneConfig(this.LoxoneHandler.loxdata);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async parseLoxoneConfig(config) {
|
|
35
|
+
// Loxone Rooms
|
|
36
|
+
for (const RoomUuid in config.rooms) {
|
|
37
|
+
this.LoxoneRooms[RoomUuid] = config.rooms[RoomUuid].name;
|
|
38
|
+
}
|
|
39
|
+
// Loxone Cats
|
|
40
|
+
for (const CatUuid in config.cats) {
|
|
41
|
+
this.LoxoneCats[CatUuid] = config.cats[CatUuid].type;
|
|
42
|
+
}
|
|
43
|
+
// Loxone Items
|
|
44
|
+
for (const ItemUuid in config.controls) {
|
|
45
|
+
const LoxoneItem = config.controls[ItemUuid];
|
|
46
|
+
if (LoxoneItem.type === 'LightControllerV2') {
|
|
47
|
+
this.parseLoxoneLightController(LoxoneItem);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.LoxoneItems[ItemUuid] = LoxoneItem;
|
|
51
|
+
this.LoxoneItems[ItemUuid].room = this.LoxoneRooms[LoxoneItem.room];
|
|
52
|
+
this.LoxoneItems[ItemUuid].cat = this.LoxoneCats[LoxoneItem.cat];
|
|
53
|
+
this.LoxoneItems[ItemUuid].type = this.checkLoxoneType(LoxoneItem);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
this.mapLoxoneItems(this.LoxoneItems);
|
|
57
|
+
}
|
|
58
|
+
parseLoxoneLightController(LightControllerV2) {
|
|
59
|
+
// Create Mood Switches
|
|
60
|
+
const moods = JSON.parse(this.LoxoneHandler.getLastCachedValue(LightControllerV2.states.moodList));
|
|
61
|
+
for (const mood of moods) {
|
|
62
|
+
if (mood.name !== 'Uit') {
|
|
63
|
+
const MoodSwitch = Object.assign({}, LightControllerV2);
|
|
64
|
+
MoodSwitch.name = `[${this.LoxoneRooms[LightControllerV2.room]}] ${mood.name}`;
|
|
65
|
+
MoodSwitch.uuidAction = `${LightControllerV2.uuidAction}/${mood.name}`;
|
|
66
|
+
MoodSwitch.type = 'MoodSwitch';
|
|
67
|
+
MoodSwitch.cat = mood.id;
|
|
68
|
+
MoodSwitch.details = {};
|
|
69
|
+
MoodSwitch.subControls = {};
|
|
70
|
+
this.LoxoneItems[`${LightControllerV2.uuidAction}/${mood.name}`] = MoodSwitch;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Create individual Lights
|
|
74
|
+
for (const childUuid in LightControllerV2.subControls) {
|
|
75
|
+
const LightItem = LightControllerV2.subControls[childUuid];
|
|
76
|
+
if (!(LightItem.uuidAction.indexOf('/masterValue') !== -1) || (LightItem.uuidAction.indexOf('/masterColor')) !== -1) {
|
|
77
|
+
this.LoxoneItems[childUuid] = LightItem;
|
|
78
|
+
this.LoxoneItems[childUuid].room = this.LoxoneRooms[LightControllerV2.room];
|
|
79
|
+
this.LoxoneItems[childUuid].cat = this.LoxoneCats[LightControllerV2.cat];
|
|
80
|
+
this.LoxoneItems[childUuid].type = this.checkLoxoneType(LightItem);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
checkLoxoneType(LoxoneItem) {
|
|
86
|
+
var _a, _b, _c, _d;
|
|
87
|
+
// Add motionSensor state to IntercomV2 Item
|
|
88
|
+
if (LoxoneItem.type === 'IntercomV2') {
|
|
89
|
+
LoxoneItem.states.active = this.LoxoneIntercomMotion;
|
|
90
|
+
}
|
|
91
|
+
if (LoxoneItem.type === 'Switch') {
|
|
92
|
+
// Map Switch with Lock Alias to LockItem
|
|
93
|
+
if (((_a = this.config.switchAlias) === null || _a === void 0 ? void 0 : _a.Lock) && LoxoneItem.name.includes(this.config.switchAlias.Lock)) {
|
|
94
|
+
return 'Lock';
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Change Pushbutton to Switch
|
|
98
|
+
if (LoxoneItem.type === 'Pushbutton') {
|
|
99
|
+
return 'Switch';
|
|
100
|
+
}
|
|
101
|
+
if (LoxoneItem.type === 'InfoOnlyAnalog') {
|
|
102
|
+
// Map InfoOnlyAnalog with Humidity Alias to HumidityItem
|
|
103
|
+
if (((_b = this.config.InfoOnlyAnalogAlias) === null || _b === void 0 ? void 0 : _b.Humidity) && LoxoneItem.name.includes(this.config.InfoOnlyAnalogAlias.Humidity)) {
|
|
104
|
+
return 'Humidity';
|
|
105
|
+
}
|
|
106
|
+
// Map InfoOnlyAnalog with Brightness Alias to HumidityItem
|
|
107
|
+
if (((_c = this.config.InfoOnlyAnalogAlias) === null || _c === void 0 ? void 0 : _c.Brightness) && LoxoneItem.name.includes(this.config.InfoOnlyAnalogAlias.Brightness)) {
|
|
108
|
+
return 'Brightness';
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (LoxoneItem.type === 'InfoOnlyDigital') {
|
|
112
|
+
// Map InfoOnlyDigital' with Motion Alias to MotionItem
|
|
113
|
+
if (((_d = this.config.InfoOnlyDigitalAlias) === null || _d === void 0 ? void 0 : _d.Motion) && LoxoneItem.name.includes(this.config.InfoOnlyDigitalAlias.Motion)) {
|
|
114
|
+
return 'Motion';
|
|
115
|
+
}
|
|
116
|
+
// Map Intercom MotionSensor to Intercom object
|
|
117
|
+
if (LoxoneItem.name.includes('IntercomV2')) {
|
|
118
|
+
this.LoxoneIntercomMotion = LoxoneItem.uuidAction;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return LoxoneItem.type;
|
|
122
|
+
}
|
|
123
|
+
async mapLoxoneItems(LoxoneItems) {
|
|
124
|
+
for (const uuid in LoxoneItems) {
|
|
125
|
+
this.log.info(`[mapLoxoneItems] Found item: ${LoxoneItems[uuid].name} with type ${LoxoneItems[uuid].type}`);
|
|
126
|
+
new LoxoneAccessory_1.LoxoneAccessory(this, LoxoneItems[uuid]);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* This function is invoked when homebridge restores cached accessories from disk at startup.
|
|
131
|
+
* It should be used to setup event handlers for characteristics and update respective values.
|
|
132
|
+
*/
|
|
133
|
+
configureAccessory(accessory) {
|
|
134
|
+
this.log.info('Loading accessory from cache:', accessory.displayName);
|
|
135
|
+
this.accessories.push(accessory);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.LoxonePlatform = LoxonePlatform;
|
|
139
|
+
//# sourceMappingURL=LoxonePlatform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoxonePlatform.js","sourceRoot":"","sources":["../src/LoxonePlatform.ts"],"names":[],"mappings":";;;;;;AACA,wEAAgD;AAChD,uDAAoD;AAGpD,MAAa,cAAc;IAazB,YACkB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAFR,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QAdlB,gBAAW,GAAG,EAAE,CAAC;QACjB,eAAU,GAAG,EAAE,CAAC;QAChB,gBAAW,GAAa,EAAE,CAAC;QAC3B,yBAAoB,GAAG,EAAE,CAAC;QAIlB,YAAO,GAAmB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/C,mBAAc,GAA0B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QACpE,gBAAW,GAAwB,EAAE,CAAC,CAAE,oDAAoD;QAO1G,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EA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,IAAI,CAAC,gCAAgC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,cAAc,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5G,IAAI,iCAAe,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9C;IACH,CAAC;IAED;;;OAGG;IACH,kBAAkB,CAAC,SAA4B;QAC7C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,+BAA+B,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;QACtE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;CACF;AA7JD,wCA6JC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;8BAGlB,GAAG;AAAlB,kBAEE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,qDAAkD;AAElD,iBAAS,CAAC,GAAQ,EAAE,EAAE;IACpB,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,+BAAc,CAAC,CAAC;AACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { LoxonePlatform } from '../LoxonePlatform';
|
|
3
|
+
export declare class Alarm {
|
|
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
|
+
/**
|
|
16
|
+
* Handle requests to get the current value of the "Security System Current State" characteristic
|
|
17
|
+
*/
|
|
18
|
+
handleSecuritySystemCurrentStateGet(): number;
|
|
19
|
+
/**
|
|
20
|
+
* Handle requests to get the current value of the "Security System Target State" characteristic
|
|
21
|
+
*/
|
|
22
|
+
handleSecuritySystemTargetStateGet(): number;
|
|
23
|
+
/**
|
|
24
|
+
* Handle requests to set the "Security System Target State" characteristic
|
|
25
|
+
*/
|
|
26
|
+
handleSecuritySystemTargetStateSet(value: any): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=Alarm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alarm.d.ts","sourceRoot":"","sources":["../../src/items/Alarm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,KAAK;IAUd,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;IAoB/C,cAAc,aAGZ;IAEF,QAAQ,YAAc;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,UAgBjD;IAEF;;OAEG;IACH,mCAAmC;IAMnC;;OAEG;IACH,kCAAkC;IAKlC;;OAEG;IACH,kCAAkC,CAAC,KAAK,KAAA;CAIzC"}
|