iobroker.hm-rpc 4.2.4 → 4.3.0
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/README.md +56 -4
- package/admin/i18n/de.json +14 -1
- package/admin/i18n/en.json +38 -25
- package/admin/i18n/es.json +14 -1
- package/admin/i18n/fr.json +14 -1
- package/admin/i18n/it.json +14 -1
- package/admin/i18n/nl.json +14 -1
- package/admin/i18n/pl.json +14 -1
- package/admin/i18n/pt.json +14 -1
- package/admin/i18n/ru.json +14 -1
- package/admin/i18n/uk.json +14 -1
- package/admin/i18n/zh-cn.json +14 -1
- package/admin/jsonConfig.json +189 -14
- package/build/lib/lite.d.ts +138 -0
- package/build/lib/lite.js +259 -0
- package/build/lib/lite.js.map +1 -0
- package/build/lib/liteConnection.d.ts +106 -0
- package/build/lib/liteConnection.js +151 -0
- package/build/lib/liteConnection.js.map +1 -0
- package/build/lib/liteNames.d.ts +78 -0
- package/build/lib/liteNames.js +189 -0
- package/build/lib/liteNames.js.map +1 -0
- package/build/lib/litePairing.d.ts +50 -0
- package/build/lib/litePairing.js +94 -0
- package/build/lib/litePairing.js.map +1 -0
- package/build/lib/tools.d.ts +12 -0
- package/build/lib/tools.js +22 -1
- package/build/lib/tools.js.map +1 -1
- package/build/lib/transitionFilter.d.ts +43 -0
- package/build/lib/transitionFilter.js +87 -0
- package/build/lib/transitionFilter.js.map +1 -0
- package/build/main.d.ts +53 -0
- package/build/main.js +310 -25
- package/build/main.js.map +1 -1
- package/io-package.json +37 -29
- package/package.json +5 -4
package/admin/jsonConfig.json
CHANGED
|
@@ -24,8 +24,12 @@
|
|
|
24
24
|
"lg": 2,
|
|
25
25
|
"xl": 2,
|
|
26
26
|
"onChange": {
|
|
27
|
-
"alsoDependsOn": [
|
|
28
|
-
|
|
27
|
+
"alsoDependsOn": [
|
|
28
|
+
"useHttps",
|
|
29
|
+
"daemon",
|
|
30
|
+
"type"
|
|
31
|
+
],
|
|
32
|
+
"calculateFunc": "data.daemon === 'openccu-lite' ? (data.useHttps ? 443 : 80) : (data.daemon === 'rfd' ? (data.useHttps && data.type !== 'bin' ? 42001 : 2001) : (data.daemon === 'virtual-devices' ? (data.useHttps && data.type !== 'bin' ? 49292 : 9292) : (data.daemon === 'hs485d' ? (data.useHttps && data.type !== 'bin' ? 42000 : 2000) : (data.daemon === 'CUxD' ? 8701 : (data.daemon === 'HMIP' ? (data.useHttps && data.type !== 'bin' ? 42010 : 2010) : (data.daemon === 'CCU-Jack' ? (data.useHttps ? 2122 : 2121) : data.homematicPort))))))",
|
|
29
33
|
"ignoreOwnChanges": true
|
|
30
34
|
}
|
|
31
35
|
},
|
|
@@ -37,7 +41,8 @@
|
|
|
37
41
|
"sm": 10,
|
|
38
42
|
"md": 6,
|
|
39
43
|
"lg": 4,
|
|
40
|
-
"xl": 4
|
|
44
|
+
"xl": 4,
|
|
45
|
+
"hidden": "data.daemon === 'openccu-lite'"
|
|
41
46
|
},
|
|
42
47
|
"port": {
|
|
43
48
|
"type": "number",
|
|
@@ -48,7 +53,8 @@
|
|
|
48
53
|
"sm": 2,
|
|
49
54
|
"md": 2,
|
|
50
55
|
"lg": 2,
|
|
51
|
-
"xl": 2
|
|
56
|
+
"xl": 2,
|
|
57
|
+
"hidden": "data.daemon === 'openccu-lite'"
|
|
52
58
|
},
|
|
53
59
|
"daemon": {
|
|
54
60
|
"newLine": true,
|
|
@@ -82,6 +88,10 @@
|
|
|
82
88
|
{
|
|
83
89
|
"label": "CCU-Jack",
|
|
84
90
|
"value": "CCU-Jack"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "openccu-lite",
|
|
94
|
+
"value": "openccu-lite"
|
|
85
95
|
}
|
|
86
96
|
],
|
|
87
97
|
"xs": 12,
|
|
@@ -104,16 +114,19 @@
|
|
|
104
114
|
}
|
|
105
115
|
],
|
|
106
116
|
"onChange": {
|
|
107
|
-
"alsoDependsOn": [
|
|
108
|
-
|
|
117
|
+
"alsoDependsOn": [
|
|
118
|
+
"daemon"
|
|
119
|
+
],
|
|
120
|
+
"calculateFunc": "data.daemon === 'CUxD' ? 'bin' : (data.daemon === 'HMIP' || data.daemon === 'virtual-devices' || data.daemon === 'CCU-Jack' || data.daemon === 'openccu-lite' ? 'xml' : data.type)",
|
|
109
121
|
"ignoreOwnChanges": true
|
|
110
122
|
},
|
|
111
|
-
"disabled": "data.daemon === 'CUxD' || data.daemon === 'HMIP' || data.daemon === 'virtual-devices' || data.daemon === 'CCU-Jack'",
|
|
123
|
+
"disabled": "data.daemon === 'CUxD' || data.daemon === 'HMIP' || data.daemon === 'virtual-devices' || data.daemon === 'CCU-Jack' || data.daemon === 'openccu-lite'",
|
|
112
124
|
"xs": 12,
|
|
113
125
|
"sm": 12,
|
|
114
126
|
"md": 4,
|
|
115
127
|
"lg": 2,
|
|
116
|
-
"xl": 2
|
|
128
|
+
"xl": 2,
|
|
129
|
+
"hidden": "data.daemon === 'openccu-lite'"
|
|
117
130
|
},
|
|
118
131
|
"forceReInit": {
|
|
119
132
|
"newLine": true,
|
|
@@ -124,6 +137,152 @@
|
|
|
124
137
|
"md": 6,
|
|
125
138
|
"lg": 4,
|
|
126
139
|
"xl": 4
|
|
140
|
+
},
|
|
141
|
+
"liteInterface": {
|
|
142
|
+
"newLine": true,
|
|
143
|
+
"type": "selectSendTo",
|
|
144
|
+
"label": "Interface",
|
|
145
|
+
"command": "lite:interfaces",
|
|
146
|
+
"jsonData": "{\"address\": \"${data.homematicAddress}\", \"port\": \"${data.homematicPort}\", \"https\": \"${data.useHttps}\", \"token\": \"${data.liteToken}\", \"fingerprint\": \"${data.liteFingerprint}\"}",
|
|
147
|
+
"alsoDependsOn": [
|
|
148
|
+
"liteToken",
|
|
149
|
+
"homematicAddress"
|
|
150
|
+
],
|
|
151
|
+
"manual": true,
|
|
152
|
+
"noTranslation": true,
|
|
153
|
+
"help": "The interface of the system this instance connects: one instance per interface",
|
|
154
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
155
|
+
"xs": 12,
|
|
156
|
+
"sm": 10,
|
|
157
|
+
"md": 6,
|
|
158
|
+
"lg": 4,
|
|
159
|
+
"xl": 4
|
|
160
|
+
},
|
|
161
|
+
"liteNames": {
|
|
162
|
+
"type": "checkbox",
|
|
163
|
+
"label": "Take names, rooms and functions from the system",
|
|
164
|
+
"help": "The devices, channels and states are named as on the system, its rooms and functions fill the enums",
|
|
165
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
166
|
+
"xs": 12,
|
|
167
|
+
"sm": 12,
|
|
168
|
+
"md": 6,
|
|
169
|
+
"lg": 4,
|
|
170
|
+
"xl": 4
|
|
171
|
+
},
|
|
172
|
+
"_litePairingHeader": {
|
|
173
|
+
"newLine": true,
|
|
174
|
+
"type": "header",
|
|
175
|
+
"text": "Pairing with the system",
|
|
176
|
+
"size": 3,
|
|
177
|
+
"hidden": "data.daemon !== 'openccu-lite'"
|
|
178
|
+
},
|
|
179
|
+
"_litePairingHelp": {
|
|
180
|
+
"type": "staticText",
|
|
181
|
+
"text": "Enter the address of the system above and press \"Pair\": a six-digit code appears below. Approve the request on the Status page of the system (as one of its administrators) - the code there must match. The token and the certificate of the system are stored in this configuration by themselves; save it afterwards. The instance must be running.",
|
|
182
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
183
|
+
"xs": 12
|
|
184
|
+
},
|
|
185
|
+
"_liteAlive": {
|
|
186
|
+
"newLine": true,
|
|
187
|
+
"type": "alive",
|
|
188
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
189
|
+
"xs": 12,
|
|
190
|
+
"sm": 12,
|
|
191
|
+
"md": 6,
|
|
192
|
+
"lg": 4,
|
|
193
|
+
"xl": 4
|
|
194
|
+
},
|
|
195
|
+
"_litePair": {
|
|
196
|
+
"type": "sendTo",
|
|
197
|
+
"label": "Pair",
|
|
198
|
+
"command": "lite:pair",
|
|
199
|
+
"jsonData": "{\"address\": \"${data.homematicAddress}\", \"port\": \"${data.homematicPort}\", \"https\": \"${data.useHttps}\"}",
|
|
200
|
+
"useNative": true,
|
|
201
|
+
"showProcess": true,
|
|
202
|
+
"timeout": 330000,
|
|
203
|
+
"variant": "contained",
|
|
204
|
+
"icon": "auth",
|
|
205
|
+
"disabled": "!data.homematicAddress",
|
|
206
|
+
"error": {
|
|
207
|
+
"no-url": {
|
|
208
|
+
"en": "Enter the address of the system first",
|
|
209
|
+
"de": "Zuerst die Adresse des Systems eingeben"
|
|
210
|
+
},
|
|
211
|
+
"unreachable": {
|
|
212
|
+
"en": "The system is not reachable at this address",
|
|
213
|
+
"de": "Das System ist unter dieser Adresse nicht erreichbar"
|
|
214
|
+
},
|
|
215
|
+
"not-openccu-lite": {
|
|
216
|
+
"en": "This address does not answer as an openccu-lite system (a CCU?)",
|
|
217
|
+
"de": "Diese Adresse antwortet nicht als openccu-lite-System (eine CCU?)"
|
|
218
|
+
},
|
|
219
|
+
"no-pairing": {
|
|
220
|
+
"en": "The system offers no pairing (too old, or pairing is switched off)",
|
|
221
|
+
"de": "Das System bietet kein Pairing an (zu alt, oder das Pairing ist ausgeschaltet)"
|
|
222
|
+
},
|
|
223
|
+
"rejected": {
|
|
224
|
+
"en": "The administrator rejected the request",
|
|
225
|
+
"de": "Der Administrator hat die Anfrage abgelehnt"
|
|
226
|
+
},
|
|
227
|
+
"expired": {
|
|
228
|
+
"en": "Nobody approved the request within five minutes",
|
|
229
|
+
"de": "Niemand hat die Anfrage innerhalb von fünf Minuten bestätigt"
|
|
230
|
+
},
|
|
231
|
+
"timeout": {
|
|
232
|
+
"en": "The pairing timed out",
|
|
233
|
+
"de": "Das Pairing hat zu lange gedauert"
|
|
234
|
+
},
|
|
235
|
+
"busy": {
|
|
236
|
+
"en": "A pairing is already running",
|
|
237
|
+
"de": "Es läuft bereits ein Pairing"
|
|
238
|
+
},
|
|
239
|
+
"certificate": {
|
|
240
|
+
"en": "The certificate of the system was not accepted",
|
|
241
|
+
"de": "Das Zertifikat des Systems wurde nicht akzeptiert"
|
|
242
|
+
},
|
|
243
|
+
"failed": {
|
|
244
|
+
"en": "The pairing failed, see the log of the instance",
|
|
245
|
+
"de": "Das Pairing ist fehlgeschlagen, siehe das Log der Instanz"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
249
|
+
"xs": 12,
|
|
250
|
+
"sm": 12,
|
|
251
|
+
"md": 6,
|
|
252
|
+
"lg": 4,
|
|
253
|
+
"xl": 4
|
|
254
|
+
},
|
|
255
|
+
"_litePairingState": {
|
|
256
|
+
"newLine": true,
|
|
257
|
+
"type": "state",
|
|
258
|
+
"oid": "info.pairing",
|
|
259
|
+
"control": "html",
|
|
260
|
+
"narrow": true,
|
|
261
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
262
|
+
"xs": 12
|
|
263
|
+
},
|
|
264
|
+
"liteToken": {
|
|
265
|
+
"newLine": true,
|
|
266
|
+
"type": "password",
|
|
267
|
+
"label": "Token",
|
|
268
|
+
"help": "Set by the pairing. An API token created on the system can be entered here as well",
|
|
269
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
270
|
+
"xs": 12,
|
|
271
|
+
"sm": 12,
|
|
272
|
+
"md": 6,
|
|
273
|
+
"lg": 4,
|
|
274
|
+
"xl": 4
|
|
275
|
+
},
|
|
276
|
+
"liteFingerprint": {
|
|
277
|
+
"type": "text",
|
|
278
|
+
"label": "Certificate fingerprint",
|
|
279
|
+
"help": "Pinned by the pairing (SHA-256). Empty: the certificate of the system must be trusted by Node.js, or the system is reached over HTTP",
|
|
280
|
+
"hidden": "data.daemon !== 'openccu-lite'",
|
|
281
|
+
"xs": 12,
|
|
282
|
+
"sm": 12,
|
|
283
|
+
"md": 6,
|
|
284
|
+
"lg": 4,
|
|
285
|
+
"xl": 4
|
|
127
286
|
}
|
|
128
287
|
}
|
|
129
288
|
},
|
|
@@ -138,7 +297,8 @@
|
|
|
138
297
|
"sm": 10,
|
|
139
298
|
"md": 6,
|
|
140
299
|
"lg": 4,
|
|
141
|
-
"xl": 4
|
|
300
|
+
"xl": 4,
|
|
301
|
+
"hidden": "data.daemon === 'openccu-lite'"
|
|
142
302
|
},
|
|
143
303
|
"checkInitInterval": {
|
|
144
304
|
"newLine": true,
|
|
@@ -149,7 +309,8 @@
|
|
|
149
309
|
"sm": 10,
|
|
150
310
|
"md": 4,
|
|
151
311
|
"lg": 2,
|
|
152
|
-
"xl": 2
|
|
312
|
+
"xl": 2,
|
|
313
|
+
"hidden": "data.daemon === 'openccu-lite'"
|
|
153
314
|
},
|
|
154
315
|
"reconnectInterval": {
|
|
155
316
|
"type": "number",
|
|
@@ -159,7 +320,8 @@
|
|
|
159
320
|
"sm": 10,
|
|
160
321
|
"md": 4,
|
|
161
322
|
"lg": 2,
|
|
162
|
-
"xl": 2
|
|
323
|
+
"xl": 2,
|
|
324
|
+
"hidden": "data.daemon === 'openccu-lite'"
|
|
163
325
|
},
|
|
164
326
|
"dontDelete": {
|
|
165
327
|
"newLine": true,
|
|
@@ -171,6 +333,17 @@
|
|
|
171
333
|
"lg": 4,
|
|
172
334
|
"xl": 4
|
|
173
335
|
},
|
|
336
|
+
"suppressTransitionalLevel": {
|
|
337
|
+
"newLine": true,
|
|
338
|
+
"type": "checkbox",
|
|
339
|
+
"label": "Suppress interim levels of moving channels",
|
|
340
|
+
"help": "LEVEL values reported with WORKING=true or PROCESS=NOT_STABLE are not written, only the final level",
|
|
341
|
+
"xs": 12,
|
|
342
|
+
"sm": 10,
|
|
343
|
+
"md": 6,
|
|
344
|
+
"lg": 4,
|
|
345
|
+
"xl": 4
|
|
346
|
+
},
|
|
174
347
|
"useHttps": {
|
|
175
348
|
"newLine": true,
|
|
176
349
|
"type": "checkbox",
|
|
@@ -182,7 +355,9 @@
|
|
|
182
355
|
"xl": 4,
|
|
183
356
|
"disabled": "data.type === 'bin'",
|
|
184
357
|
"onChange": {
|
|
185
|
-
"alsoDependsOn": [
|
|
358
|
+
"alsoDependsOn": [
|
|
359
|
+
"type"
|
|
360
|
+
],
|
|
186
361
|
"calculateFunc": "data.type === 'bin' ? false : data.useHttps"
|
|
187
362
|
}
|
|
188
363
|
},
|
|
@@ -195,13 +370,13 @@
|
|
|
195
370
|
"md": 4,
|
|
196
371
|
"lg": 4,
|
|
197
372
|
"xl": 4,
|
|
198
|
-
"hidden": "data.type === 'bin'"
|
|
373
|
+
"hidden": "data.type === 'bin' || data.daemon === 'openccu-lite'"
|
|
199
374
|
},
|
|
200
375
|
"password": {
|
|
201
376
|
"repeat": true,
|
|
202
377
|
"type": "password",
|
|
203
378
|
"label": "Password",
|
|
204
|
-
"hidden": "data.type === 'bin'",
|
|
379
|
+
"hidden": "data.type === 'bin' || data.daemon === 'openccu-lite'",
|
|
205
380
|
"xs": 12,
|
|
206
381
|
"sm": 6,
|
|
207
382
|
"md": 4,
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure parts of the openccu-lite mode: nothing here talks to the system or to ioBroker.
|
|
3
|
+
*
|
|
4
|
+
* openccu-lite is a CCU firmware without ReGaHSS. Its interface processes are reached through lite-rpc
|
|
5
|
+
* (`/api/rpc/v1`): the requests over HTTP(S) with a token, the events as a stream the adapter opens -
|
|
6
|
+
* no callback server, no `init`. The names and rooms of devices and channels are the system's metadata.
|
|
7
|
+
*/
|
|
8
|
+
import type { Daemon } from './_types';
|
|
9
|
+
/** The interfaces lite-rpc carries (the names of `InterfacesList.xml`, as `GET /api/rpc/v1/interfaces` lists them) */
|
|
10
|
+
export declare const LITE_INTERFACES: readonly ["HmIP-RF", "BidCos-RF", "BidCos-Wired", "VirtualDevices"];
|
|
11
|
+
/** The scopes the pairing asks for: paramsets are written (`configure`), the names are read */
|
|
12
|
+
export declare const LITE_ACCESS: {
|
|
13
|
+
readonly devices: "configure";
|
|
14
|
+
readonly names: "read";
|
|
15
|
+
};
|
|
16
|
+
/** The pairing waits at most this long for the approval (the system lets a request expire after five minutes) */
|
|
17
|
+
export declare const PAIRING_TIMEOUT_MS: number;
|
|
18
|
+
/** What the adapter answers the admin when a pairing does not end with a token */
|
|
19
|
+
export type PairingErrorCode = 'no-url' | 'unreachable' | 'not-openccu-lite' | 'no-pairing' | 'rejected' | 'expired' | 'timeout' | 'busy' | 'certificate' | 'failed';
|
|
20
|
+
/** The state of a pairing, as the instance state `info.pairing` shows it */
|
|
21
|
+
export type PairingState = {
|
|
22
|
+
phase: 'idle';
|
|
23
|
+
} | {
|
|
24
|
+
phase: 'requesting';
|
|
25
|
+
url: string;
|
|
26
|
+
} | {
|
|
27
|
+
phase: 'waiting';
|
|
28
|
+
url: string;
|
|
29
|
+
code: string;
|
|
30
|
+
} | {
|
|
31
|
+
phase: 'approved';
|
|
32
|
+
url: string;
|
|
33
|
+
} | {
|
|
34
|
+
phase: 'failed';
|
|
35
|
+
url: string;
|
|
36
|
+
error: PairingErrorCode;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The daemon an interface of the system corresponds to. The daemon decides the CCU specific fixes of the
|
|
40
|
+
* paramset descriptions (`fixParamset`) and which devices are filtered on `newDevices`, so the lite mode
|
|
41
|
+
* derives it from the interface instead of asking the user twice.
|
|
42
|
+
*
|
|
43
|
+
* @param iface the interface name, e.g. `HmIP-RF`
|
|
44
|
+
*/
|
|
45
|
+
export declare function interfaceDaemon(iface: string): Daemon;
|
|
46
|
+
/** The fields of the instance configuration that name the system (the same as for a CCU) */
|
|
47
|
+
export interface LiteAddress {
|
|
48
|
+
homematicAddress: string;
|
|
49
|
+
homematicPort: string;
|
|
50
|
+
useHttps: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The URL of the system from the configuration: `https://<address>:<port>` (`http://` without TLS), the default
|
|
54
|
+
* port of the scheme left out. A scheme or a path the user typed into the address is dropped; blanks are trimmed.
|
|
55
|
+
* An empty address gives an empty URL.
|
|
56
|
+
*
|
|
57
|
+
* @param config the address fields
|
|
58
|
+
*/
|
|
59
|
+
export declare function liteUrlOf(config: LiteAddress): string;
|
|
60
|
+
/**
|
|
61
|
+
* The address fields for a URL of the system (the one the pairing stored, after the system's redirect)
|
|
62
|
+
*
|
|
63
|
+
* @param url the system's URL, e.g. `https://192.168.1.20`
|
|
64
|
+
*/
|
|
65
|
+
export declare function liteUrlParts(url: string): LiteAddress;
|
|
66
|
+
/**
|
|
67
|
+
* The code the admin shows for an error of the pairing. occulite-client reports its errors as
|
|
68
|
+
* `OccuLiteError` with a `code`; everything else is `failed`.
|
|
69
|
+
*
|
|
70
|
+
* @param e the error
|
|
71
|
+
*/
|
|
72
|
+
export declare function pairingErrorCode(e: unknown): PairingErrorCode;
|
|
73
|
+
/**
|
|
74
|
+
* The text of the instance state `info.pairing`, which the admin shows live while a pairing runs: the code
|
|
75
|
+
* with a link to the system's Status page, then the result. HTML, in German or English (English for every
|
|
76
|
+
* other language of the system).
|
|
77
|
+
*
|
|
78
|
+
* @param state the pairing's state
|
|
79
|
+
* @param lang the system language of ioBroker
|
|
80
|
+
*/
|
|
81
|
+
export declare function pairingHtml(state: PairingState, lang: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* The error string of a failed lite-rpc call for the callback of `methodCall`, in the shape hm-rpc's retry
|
|
84
|
+
* expects: a fault of the interface process is its fault string (`Failure`, `… (UNREACH)`), everything else
|
|
85
|
+
* names the client's error code.
|
|
86
|
+
*
|
|
87
|
+
* @param e the error occulite-client threw
|
|
88
|
+
*/
|
|
89
|
+
export declare function rpcCallbackError(e: unknown): string;
|
|
90
|
+
/**
|
|
91
|
+
* The id of a device or channel object in ioBroker (relative to the namespace) for a CCU address
|
|
92
|
+
*
|
|
93
|
+
* @param address the address, e.g. `000A1B2C3D4E5F:1`
|
|
94
|
+
*/
|
|
95
|
+
export declare function objectIdOfAddress(address: string): string;
|
|
96
|
+
/**
|
|
97
|
+
* The reference of a device or channel in the system's metadata, as occulite-client keys it
|
|
98
|
+
*
|
|
99
|
+
* @param iface the interface name
|
|
100
|
+
* @param address the address
|
|
101
|
+
*/
|
|
102
|
+
export declare function refOfAddress(iface: string, address: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* The name of a datapoint object: `<channel name>.<DATAPOINT>` when the system names the channel (as hm-rega
|
|
105
|
+
* names them), else the datapoint alone (hm-rpc's own default)
|
|
106
|
+
*
|
|
107
|
+
* @param channelName the channel's name in the system, or undefined
|
|
108
|
+
* @param datapoint the datapoint, e.g. `STATE`
|
|
109
|
+
*/
|
|
110
|
+
export declare function datapointName(channelName: string | undefined, datapoint: string): string;
|
|
111
|
+
/**
|
|
112
|
+
* The id of the ioBroker enum for a node of the system's taxonomy: a room tree is flattened, every node is an
|
|
113
|
+
* enum of its own named by its path (`room/eg/bad` → `enum.rooms.eg_bad`), so two rooms `bad` on two floors
|
|
114
|
+
* stay apart. Undefined for an enum of the system ioBroker has no counterpart for.
|
|
115
|
+
*
|
|
116
|
+
* @param path the node's path, e.g. `room/eg/bad`
|
|
117
|
+
*/
|
|
118
|
+
export declare function enumIdOfPath(path: string): string | undefined;
|
|
119
|
+
/** An ioBroker enum an object belongs to directly (one of its innermost nodes) */
|
|
120
|
+
export interface EnumMembership {
|
|
121
|
+
/** the enum object's id, e.g. `enum.rooms.eg_bad` */
|
|
122
|
+
id: string;
|
|
123
|
+
/** the node's name in the language asked for */
|
|
124
|
+
name: string;
|
|
125
|
+
/** the node's path in the system, e.g. `room/eg/bad` */
|
|
126
|
+
path: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The ioBroker enums an object belongs to: its direct nodes in the system's taxonomy, each mapped to a flat enum
|
|
130
|
+
* (a channel in `room/eg/bad` is a member of `enum.rooms.eg_bad` and not of `enum.rooms.eg` - the innermost room, as
|
|
131
|
+
* hm-rega handles the CCU's flat rooms)
|
|
132
|
+
*
|
|
133
|
+
* @param nodes the direct nodes of the object (`membership(ref, {inherit: false})` of occulite-client, rooms and functions together)
|
|
134
|
+
*/
|
|
135
|
+
export declare function enumsOfNodes(nodes: {
|
|
136
|
+
path: string;
|
|
137
|
+
name: string;
|
|
138
|
+
}[]): EnumMembership[];
|