homematic-manager 3.4.1 → 3.5.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/data/cross-validations.json +14 -0
- package/data/easymode-time-selectors.json +1 -1
- package/data/manifest.json +12 -12
- package/data/master-forms.json +245 -24
- package/data/master-metadata.json +323 -9
- package/data/translations/de.json +12 -1
- package/data/translations/en.json +11 -0
- package/node_modules/@homematic-manager/backend/dist/api/backend.js +28 -5
- package/node_modules/@homematic-manager/backend/dist/rega/scripts.d.ts +12 -6
- package/node_modules/@homematic-manager/backend/dist/rega/scripts.js +17 -8
- package/node_modules/@homematic-manager/backend/dist/write/paramset.d.ts +10 -0
- package/node_modules/@homematic-manager/backend/dist/write/paramset.js +22 -1
- package/node_modules/@homematic-manager/backend/dist/write/repair.d.ts +7 -7
- package/node_modules/@homematic-manager/backend/dist/write/repair.js +5 -14
- package/node_modules/@homematic-manager/backend/package.json +1 -1
- package/node_modules/@homematic-manager/core/dist/api/types.d.ts +15 -0
- package/node_modules/@homematic-manager/core/dist/data/types.d.ts +6 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/engine.d.ts +2 -1
- package/node_modules/@homematic-manager/core/dist/easymodes/engine.js +16 -7
- package/node_modules/@homematic-manager/core/dist/easymodes/legacyValues.d.ts +28 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/legacyValues.js +97 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/senderForms.d.ts +101 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/senderForms.js +251 -0
- package/node_modules/@homematic-manager/core/dist/index.d.ts +4 -0
- package/node_modules/@homematic-manager/core/dist/index.js +4 -0
- package/node_modules/@homematic-manager/core/dist/interfaces/table.d.ts +14 -0
- package/node_modules/@homematic-manager/core/dist/interfaces/table.js +20 -0
- package/node_modules/@homematic-manager/core/dist/links/partnerFilter.d.ts +55 -0
- package/node_modules/@homematic-manager/core/dist/links/partnerFilter.js +235 -0
- package/node_modules/@homematic-manager/core/dist/paramset/cast.d.ts +37 -0
- package/node_modules/@homematic-manager/core/dist/paramset/cast.js +61 -1
- package/node_modules/@homematic-manager/core/dist/paramset/diff.d.ts +15 -0
- package/node_modules/@homematic-manager/core/dist/paramset/diff.js +16 -2
- package/node_modules/@homematic-manager/core/dist/paramset/powerMeter.d.ts +40 -0
- package/node_modules/@homematic-manager/core/dist/paramset/powerMeter.js +47 -0
- package/node_modules/@homematic-manager/core/dist/paramset/units.d.ts +11 -0
- package/node_modules/@homematic-manager/core/dist/paramset/units.js +19 -0
- package/node_modules/@homematic-manager/core/package.json +1 -1
- package/package.json +4 -4
- package/ui/assets/index-BGYochtr.js +21 -0
- package/ui/assets/index-Cd-Vx9ge.css +1 -0
- package/ui/index.html +2 -2
- package/ui/assets/index-D94DHu87.css +0 -1
- package/ui/assets/index-j1HvLwHX.js +0 -21
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* main process with it, issue #127).
|
|
15
15
|
*/
|
|
16
16
|
import path from 'node:path';
|
|
17
|
-
import { RPC_METHOD_NAMES, RSSI_UNKNOWN, countsAsServiceMessage, isAcknowledgeable, isKnownInterface, maintenanceAddress, mergeMethodHelp, methodsFor, callbackPinOption, normaliseDescription, repairMisdecodedUtf8, } from '@homematic-manager/core';
|
|
17
|
+
import { RPC_METHOD_NAMES, RSSI_UNKNOWN, countsAsServiceMessage, isAcknowledgeable, isKnownInterface, offersConfigMaintenance, maintenanceAddress, mergeMethodHelp, methodsFor, callbackPinOption, normaliseDescription, repairMisdecodedUtf8, } from '@homematic-manager/core';
|
|
18
18
|
import { CacheStore } from '../cache/store.js';
|
|
19
19
|
import { ConfigStore } from '../config/store.js';
|
|
20
20
|
import { LinkTemplateStore } from '../config/linkTemplates.js';
|
|
@@ -192,6 +192,7 @@ export class Backend {
|
|
|
192
192
|
describe: (interfaceName, address, paramset) => this.#describe(interfaceName, address, paramset),
|
|
193
193
|
read: (interfaceName, method, params) => this.#read(interfaceName, method, params),
|
|
194
194
|
write: (interfaceName, method, params) => this.#write(interfaceName, method, params),
|
|
195
|
+
offers: (interfaceName, method) => this.#offersConfigMaintenance(interfaceName, method),
|
|
195
196
|
onProgress: (progress) => {
|
|
196
197
|
this.events.emit('write.progress', progress);
|
|
197
198
|
},
|
|
@@ -390,6 +391,10 @@ export class Backend {
|
|
|
390
391
|
case 'interfaces.reconnect':
|
|
391
392
|
await this.#requireManager().reconnect(p[0]);
|
|
392
393
|
return null;
|
|
394
|
+
case 'interfaces.methodNames': {
|
|
395
|
+
const listed = await this.#methodList(p[0]);
|
|
396
|
+
return listed === undefined ? null : [...listed];
|
|
397
|
+
}
|
|
393
398
|
case 'rega.state':
|
|
394
399
|
return this.#rega?.state ?? { enabled: this.#config.connection.rega, reachable: false, names: 0 };
|
|
395
400
|
case 'devices.list':
|
|
@@ -403,10 +408,10 @@ export class Backend {
|
|
|
403
408
|
case 'devices.reportValueUsage':
|
|
404
409
|
return Number(await this.#write(p[0], 'reportValueUsage', [p[1], p[2], p[3]]));
|
|
405
410
|
case 'devices.restoreConfig':
|
|
406
|
-
await this.#
|
|
411
|
+
await this.#configMaintenance(p[0], 'restoreConfigToDevice', p[1]);
|
|
407
412
|
return null;
|
|
408
413
|
case 'devices.clearConfigCache':
|
|
409
|
-
await this.#
|
|
414
|
+
await this.#configMaintenance(p[0], 'clearConfigCache', p[1]);
|
|
410
415
|
return null;
|
|
411
416
|
case 'devices.repairConfig':
|
|
412
417
|
return this.#repair.repair(p[0], p[1], params[2] ?? {});
|
|
@@ -1782,8 +1787,9 @@ export class Backend {
|
|
|
1782
1787
|
return listed === undefined || listed.has('getServiceMessages');
|
|
1783
1788
|
}
|
|
1784
1789
|
/**
|
|
1785
|
-
* B-26 (#158): the methods
|
|
1786
|
-
*
|
|
1790
|
+
* B-26 (#158): the methods an interface lists in `system.listMethods`, or `undefined` when it
|
|
1791
|
+
* gave no usable list. Used for user-defined interfaces' service messages and, since task 115,
|
|
1792
|
+
* for the BidCos maintenance calls of every interface.
|
|
1787
1793
|
*
|
|
1788
1794
|
* Asked once and shared by concurrent callers; the answer is dropped when the interface
|
|
1789
1795
|
* subscribes again. A process that does not have `system.listMethods` either is remembered for
|
|
@@ -1813,6 +1819,22 @@ export class Backend {
|
|
|
1813
1819
|
this.#listedMethods.set(interfaceName, pending);
|
|
1814
1820
|
return pending;
|
|
1815
1821
|
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Task 115: does this interface offer `restoreConfigToDevice` / `clearConfigCache`? Its own
|
|
1824
|
+
* `system.listMethods` decides, never on HmIP; see `offersConfigMaintenance`.
|
|
1825
|
+
*/
|
|
1826
|
+
async #offersConfigMaintenance(interfaceName, method) {
|
|
1827
|
+
const listed = await this.#methodList(interfaceName);
|
|
1828
|
+
const type = this.#manager?.states().find((state) => state.name === interfaceName)?.type ?? '';
|
|
1829
|
+
return offersConfigMaintenance(interfaceName, type, method, listed);
|
|
1830
|
+
}
|
|
1831
|
+
/** `devices.restoreConfig` and `devices.clearConfigCache`: refused where the interface lacks the method. */
|
|
1832
|
+
async #configMaintenance(interfaceName, method, address) {
|
|
1833
|
+
if (!(await this.#offersConfigMaintenance(interfaceName, method))) {
|
|
1834
|
+
throw validationError(`${interfaceName} does not offer ${method}`);
|
|
1835
|
+
}
|
|
1836
|
+
await this.#write(interfaceName, method, [address]);
|
|
1837
|
+
}
|
|
1816
1838
|
/** Reads the BidCos service messages of one interface into the store. */
|
|
1817
1839
|
async #refreshServiceMessages(interfaceName) {
|
|
1818
1840
|
if (!(await this.#hasServiceMessages(interfaceName))) {
|
|
@@ -2183,6 +2205,7 @@ export const API_METHOD_NAMES = [
|
|
|
2183
2205
|
'connection.pairCancel',
|
|
2184
2206
|
'interfaces.list',
|
|
2185
2207
|
'interfaces.reconnect',
|
|
2208
|
+
'interfaces.methodNames',
|
|
2186
2209
|
'rega.state',
|
|
2187
2210
|
'devices.list',
|
|
2188
2211
|
'devices.description',
|
|
@@ -84,9 +84,14 @@ export declare function acknowledgeAlarmScript(interfaceName: string, address: s
|
|
|
84
84
|
* B-74 (#150): an alarm stays oncoming until it is receipted, whatever the interface process
|
|
85
85
|
* reports meanwhile - rfd forgets a `STICKY_UNREACH` at a restart, ReGa does not - so the
|
|
86
86
|
* WebUI lists messages `getServiceMessages` does not. The value is what such a message is shown
|
|
87
|
-
* with.
|
|
87
|
+
* with. *
|
|
88
|
+
* Task 119: the name and the value go out through `WriteURL()`, like every other name this
|
|
89
|
+
* application reads from ReGa, so a tab or a line break in either cannot shift the fields or split
|
|
90
|
+
* the line (the CCU WebUI's lists broke on such names, OpenCCU-Base #304 and others). The value is
|
|
91
|
+
* `Value().ToString()`, which prints what `Write(Value())` printed: `true`/`false`, `21.500000`,
|
|
92
|
+
* an ENUM's index (checked on the lab's stock OpenCCU 3.89.8).
|
|
88
93
|
*/
|
|
89
|
-
export declare const REGA_ALARMS_SCRIPT = "string sId;\nforeach (sId, dom.GetObject(ID_SERVICES).EnumIDs()) {\n object oAlarm = dom.GetObject(sId);\n if (oAlarm) {\n if (oAlarm.IsTypeOf(OT_ALARMDP) && (oAlarm.Used() == true) && (oAlarm.Enabled() == true) && (oAlarm.AlState() == asOncoming)) {\n object oTrigger = dom.GetObject(oAlarm.AlTriggerDP());\n if (oTrigger) {\n
|
|
94
|
+
export declare const REGA_ALARMS_SCRIPT = "string sId;\nforeach (sId, dom.GetObject(ID_SERVICES).EnumIDs()) {\n object oAlarm = dom.GetObject(sId);\n if (oAlarm) {\n if (oAlarm.IsTypeOf(OT_ALARMDP) && (oAlarm.Used() == true) && (oAlarm.Enabled() == true) && (oAlarm.AlState() == asOncoming)) {\n object oTrigger = dom.GetObject(oAlarm.AlTriggerDP());\n if (oTrigger) {\n WriteURL(oTrigger.Name());\n Write(\"\\t\" # oAlarm.AlOccurrenceTime().ToInteger() # \"\\t\" # oAlarm.Timestamp().ToInteger() # \"\\t\");\n WriteURL(oTrigger.Value().ToString());\n Write(\"\\n\");\n }\n }\n }\n}\n";
|
|
90
95
|
/** One pending ReGa service message: whose datapoint, its value, first and last reported (epoch ms). */
|
|
91
96
|
export interface RegaAlarm {
|
|
92
97
|
readonly interfaceName: string;
|
|
@@ -98,10 +103,11 @@ export interface RegaAlarm {
|
|
|
98
103
|
readonly last: number;
|
|
99
104
|
}
|
|
100
105
|
/**
|
|
101
|
-
* Reads what {@link REGA_ALARMS_SCRIPT} wrote.
|
|
102
|
-
* (
|
|
103
|
-
*
|
|
104
|
-
*
|
|
106
|
+
* Reads what {@link REGA_ALARMS_SCRIPT} wrote. Name and value are `WriteURL()`-escaped and decoded
|
|
107
|
+
* here (task 119). A line whose name is not `<interface>.<channel>.<datapoint>` (a system alarm, a
|
|
108
|
+
* CUxD name with more dots) or whose time is no positive number is skipped. The value column is
|
|
109
|
+
* ReGa's text of the value: `true`/`false`, a number as it prints it (an ENUM by its index),
|
|
110
|
+
* anything else stays a string; a line without it means `true`.
|
|
105
111
|
*/
|
|
106
112
|
export declare function parseRegaAlarms(output: string): RegaAlarm[];
|
|
107
113
|
/**
|
|
@@ -135,7 +135,12 @@ Write(iDone);
|
|
|
135
135
|
* B-74 (#150): an alarm stays oncoming until it is receipted, whatever the interface process
|
|
136
136
|
* reports meanwhile - rfd forgets a `STICKY_UNREACH` at a restart, ReGa does not - so the
|
|
137
137
|
* WebUI lists messages `getServiceMessages` does not. The value is what such a message is shown
|
|
138
|
-
* with.
|
|
138
|
+
* with. *
|
|
139
|
+
* Task 119: the name and the value go out through `WriteURL()`, like every other name this
|
|
140
|
+
* application reads from ReGa, so a tab or a line break in either cannot shift the fields or split
|
|
141
|
+
* the line (the CCU WebUI's lists broke on such names, OpenCCU-Base #304 and others). The value is
|
|
142
|
+
* `Value().ToString()`, which prints what `Write(Value())` printed: `true`/`false`, `21.500000`,
|
|
143
|
+
* an ENUM's index (checked on the lab's stock OpenCCU 3.89.8).
|
|
139
144
|
*/
|
|
140
145
|
export const REGA_ALARMS_SCRIPT = `string sId;
|
|
141
146
|
foreach (sId, dom.GetObject(ID_SERVICES).EnumIDs()) {
|
|
@@ -144,23 +149,27 @@ foreach (sId, dom.GetObject(ID_SERVICES).EnumIDs()) {
|
|
|
144
149
|
if (oAlarm.IsTypeOf(OT_ALARMDP) && (oAlarm.Used() == true) && (oAlarm.Enabled() == true) && (oAlarm.AlState() == asOncoming)) {
|
|
145
150
|
object oTrigger = dom.GetObject(oAlarm.AlTriggerDP());
|
|
146
151
|
if (oTrigger) {
|
|
147
|
-
|
|
152
|
+
WriteURL(oTrigger.Name());
|
|
153
|
+
Write("\\t" # oAlarm.AlOccurrenceTime().ToInteger() # "\\t" # oAlarm.Timestamp().ToInteger() # "\\t");
|
|
154
|
+
WriteURL(oTrigger.Value().ToString());
|
|
155
|
+
Write("\\n");
|
|
148
156
|
}
|
|
149
157
|
}
|
|
150
158
|
}
|
|
151
159
|
}
|
|
152
160
|
`;
|
|
153
161
|
/**
|
|
154
|
-
* Reads what {@link REGA_ALARMS_SCRIPT} wrote.
|
|
155
|
-
* (
|
|
156
|
-
*
|
|
157
|
-
*
|
|
162
|
+
* Reads what {@link REGA_ALARMS_SCRIPT} wrote. Name and value are `WriteURL()`-escaped and decoded
|
|
163
|
+
* here (task 119). A line whose name is not `<interface>.<channel>.<datapoint>` (a system alarm, a
|
|
164
|
+
* CUxD name with more dots) or whose time is no positive number is skipped. The value column is
|
|
165
|
+
* ReGa's text of the value: `true`/`false`, a number as it prints it (an ENUM by its index),
|
|
166
|
+
* anything else stays a string; a line without it means `true`.
|
|
158
167
|
*/
|
|
159
168
|
export function parseRegaAlarms(output) {
|
|
160
169
|
const alarms = [];
|
|
161
170
|
for (const line of output.split('\n')) {
|
|
162
171
|
const [name, first, last, value] = line.split('\t');
|
|
163
|
-
const match = /^([^.\s]+)\.([^.\s]+)\.([^.\s]+)$/u.exec(name?.trim() ?? '');
|
|
172
|
+
const match = /^([^.\s]+)\.([^.\s]+)\.([^.\s]+)$/u.exec(unescapeRegaUrl(name?.trim() ?? ''));
|
|
164
173
|
const firstSeconds = Number(first);
|
|
165
174
|
const lastSeconds = Number(last);
|
|
166
175
|
if (!match || !Number.isFinite(firstSeconds) || firstSeconds <= 0) {
|
|
@@ -170,7 +179,7 @@ export function parseRegaAlarms(output) {
|
|
|
170
179
|
interfaceName: match[1] ?? '',
|
|
171
180
|
address: match[2] ?? '',
|
|
172
181
|
datapoint: match[3] ?? '',
|
|
173
|
-
value: parseRegaValue(value),
|
|
182
|
+
value: parseRegaValue(value === undefined ? undefined : unescapeRegaUrl(value)),
|
|
174
183
|
first: firstSeconds * 1000,
|
|
175
184
|
last: Number.isFinite(lastSeconds) && lastSeconds > 0 ? lastSeconds * 1000 : firstSeconds * 1000,
|
|
176
185
|
});
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* `NaN` never reaches the wire;
|
|
17
17
|
* 4. the call goes through the paced write queue and into the write log.
|
|
18
18
|
*
|
|
19
|
+
* A **link paramset is written whole** (task 113): once one of its parameters changed, every
|
|
20
|
+
* writable parameter goes out with the value just read, the edits on top. The CCU's WebUI went
|
|
21
|
+
* back to that in 2026, after sending only the changed link parameters had reset the others on
|
|
22
|
+
* devices in the field. `changedOnly` is the opt-out; MASTER and VALUES keep the changed-only rule.
|
|
23
|
+
*
|
|
19
24
|
* Multi-apply is restricted to channels whose paramset description **identity** is equal
|
|
20
25
|
* (`multiApplyEligibility()`, task 6.3). 2.x offered every channel with the same `TYPE` and never
|
|
21
26
|
* compared descriptions, which is exactly what put more than 100 devices into `CONFIG_PENDING`.
|
|
@@ -72,6 +77,11 @@ export declare class ParamsetWriter {
|
|
|
72
77
|
* A link paramset is addressed as `putParamset(<channel>, <peer address>, values)`, so
|
|
73
78
|
* "sender to receiver" is written on the sender with the receiver as the key and the other way
|
|
74
79
|
* round - exactly what `putLinkParamset()` of 2.x did.
|
|
80
|
+
*
|
|
81
|
+
* `values` are the edits. A direction none of whose parameters changed is not written at all;
|
|
82
|
+
* one that has a change is written whole unless `options.changedOnly` is set - per link from that
|
|
83
|
+
* link's own stored values, so applying an edit to several links never copies one link's other
|
|
84
|
+
* parameters to the next.
|
|
75
85
|
*/
|
|
76
86
|
putLink(interfaceName: string, links: readonly LinkTarget[], values: {
|
|
77
87
|
senderToReceiver?: ParamsetWrite;
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* `NaN` never reaches the wire;
|
|
17
17
|
* 4. the call goes through the paced write queue and into the write log.
|
|
18
18
|
*
|
|
19
|
+
* A **link paramset is written whole** (task 113): once one of its parameters changed, every
|
|
20
|
+
* writable parameter goes out with the value just read, the edits on top. The CCU's WebUI went
|
|
21
|
+
* back to that in 2026, after sending only the changed link parameters had reset the others on
|
|
22
|
+
* devices in the field. `changedOnly` is the opt-out; MASTER and VALUES keep the changed-only rule.
|
|
23
|
+
*
|
|
19
24
|
* Multi-apply is restricted to channels whose paramset description **identity** is equal
|
|
20
25
|
* (`multiApplyEligibility()`, task 6.3). 2.x offered every channel with the same `TYPE` and never
|
|
21
26
|
* compared descriptions, which is exactly what put more than 100 devices into `CONFIG_PENDING`.
|
|
@@ -107,6 +112,11 @@ export class ParamsetWriter {
|
|
|
107
112
|
* A link paramset is addressed as `putParamset(<channel>, <peer address>, values)`, so
|
|
108
113
|
* "sender to receiver" is written on the sender with the receiver as the key and the other way
|
|
109
114
|
* round - exactly what `putLinkParamset()` of 2.x did.
|
|
115
|
+
*
|
|
116
|
+
* `values` are the edits. A direction none of whose parameters changed is not written at all;
|
|
117
|
+
* one that has a change is written whole unless `options.changedOnly` is set - per link from that
|
|
118
|
+
* link's own stored values, so applying an edit to several links never copies one link's other
|
|
119
|
+
* parameters to the next.
|
|
110
120
|
*/
|
|
111
121
|
async putLink(interfaceName, links, values, options = {}) {
|
|
112
122
|
if (links.length === 0) {
|
|
@@ -140,6 +150,7 @@ export class ParamsetWriter {
|
|
|
140
150
|
const result = await this.#putOne(interfaceName, owner, 'LINK', peer, direction.values, options, {
|
|
141
151
|
peer,
|
|
142
152
|
alwaysSend: ALWAYS_SENT_LINK_PARAMETERS,
|
|
153
|
+
full: options.changedOnly !== true && options.writeAll !== true,
|
|
143
154
|
});
|
|
144
155
|
results.push(result);
|
|
145
156
|
done += 1;
|
|
@@ -227,7 +238,7 @@ export class ParamsetWriter {
|
|
|
227
238
|
writeAll: options.writeAll === true,
|
|
228
239
|
enumAs: enumEncodingFor(interfaceName),
|
|
229
240
|
});
|
|
230
|
-
|
|
241
|
+
let sent = { ...diff.values };
|
|
231
242
|
for (const parameter of extra.alwaysSend ?? []) {
|
|
232
243
|
addAlwaysSent(sent, diff.values, values, description, parameter, interfaceName);
|
|
233
244
|
}
|
|
@@ -238,6 +249,16 @@ export class ParamsetWriter {
|
|
|
238
249
|
if (Object.keys(sent).length === 0) {
|
|
239
250
|
return { ...base, sent, ok: true, skipped: true, problems: [] };
|
|
240
251
|
}
|
|
252
|
+
if (extra.full === true) {
|
|
253
|
+
// something changed, so the paramset goes out whole: what was read, the edits on top.
|
|
254
|
+
// Only the payload is taken from this second pass - what is wrong with the edits the
|
|
255
|
+
// first one has already said, and a stored value that does not validate stays unsent.
|
|
256
|
+
const whole = diffParamset(original, values, description, {
|
|
257
|
+
full: true,
|
|
258
|
+
enumAs: enumEncodingFor(interfaceName),
|
|
259
|
+
});
|
|
260
|
+
sent = { ...whole.values, ...sent };
|
|
261
|
+
}
|
|
241
262
|
if (options.dryRun === true) {
|
|
242
263
|
return { ...base, sent, ok: true, skipped: true, problems: [] };
|
|
243
264
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* channel with one is reported as `unrepairable`, and the dialog of task 8 has to explain what that
|
|
25
25
|
* means for the device.
|
|
26
26
|
*/
|
|
27
|
-
import { type DeviceIndex, type ParameterDescription, type ParamsetDescription, type RepairConfigOptions, type RepairConfigResult, type RpcValue, type RpcWriteValue, type WriteResult } from '@homematic-manager/core';
|
|
27
|
+
import { type ConfigMaintenanceMethod, type DeviceIndex, type ParameterDescription, type ParamsetDescription, type RepairConfigOptions, type RepairConfigResult, type RpcValue, type RpcWriteValue, type WriteResult } from '@homematic-manager/core';
|
|
28
28
|
import type { RpcOutValue } from '../rpc/client.js';
|
|
29
29
|
/** What the repair needs from the backend; the same shape the paramset writer uses. */
|
|
30
30
|
export interface ConfigRepairDeps {
|
|
@@ -32,18 +32,18 @@ export interface ConfigRepairDeps {
|
|
|
32
32
|
describe(interfaceName: string, address: string, paramset: string): Promise<ParamsetDescription>;
|
|
33
33
|
read(interfaceName: string, method: string, params: readonly RpcOutValue[]): Promise<RpcValue>;
|
|
34
34
|
write(interfaceName: string, method: string, params: readonly RpcOutValue[]): Promise<RpcValue>;
|
|
35
|
+
/**
|
|
36
|
+
* Task 115: does this interface offer `clearConfigCache` / `restoreConfigToDevice`? Never on
|
|
37
|
+
* hmipserver (it lists both and answers `-1 Generic error` to every call); elsewhere its own
|
|
38
|
+
* `system.listMethods` decides - hs485d of an eQ-3 CCU3 has neither (`offersConfigMaintenance`).
|
|
39
|
+
*/
|
|
40
|
+
offers(interfaceName: string, method: ConfigMaintenanceMethod): Promise<boolean>;
|
|
35
41
|
onProgress(progress: {
|
|
36
42
|
done: number;
|
|
37
43
|
total: number;
|
|
38
44
|
last?: WriteResult;
|
|
39
45
|
}): void;
|
|
40
46
|
}
|
|
41
|
-
/**
|
|
42
|
-
* `clearConfigCache` and `restoreConfigToDevice` exist in hmipserver's `system.listMethods` and
|
|
43
|
-
* answer `-1 Generic error` to every call: they are BidCos methods. Offering them for an HmIP
|
|
44
|
-
* device would only produce a fault the user cannot act on.
|
|
45
|
-
*/
|
|
46
|
-
export declare function supportsBidcosMaintenance(interfaceName: string): boolean;
|
|
47
47
|
/** A value that is certainly valid for this parameter, for a stored one that is not. */
|
|
48
48
|
export declare function fallbackValue(parameter: ParameterDescription): RpcWriteValue | undefined;
|
|
49
49
|
export declare class ConfigRepair {
|
|
@@ -26,14 +26,6 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import { castValue, enumEncodingFor, isWritable, validateValue, } from '@homematic-manager/core';
|
|
28
28
|
import { toApiError, validationError } from '../errors.js';
|
|
29
|
-
/**
|
|
30
|
-
* `clearConfigCache` and `restoreConfigToDevice` exist in hmipserver's `system.listMethods` and
|
|
31
|
-
* answer `-1 Generic error` to every call: they are BidCos methods. Offering them for an HmIP
|
|
32
|
-
* device would only produce a fault the user cannot act on.
|
|
33
|
-
*/
|
|
34
|
-
export function supportsBidcosMaintenance(interfaceName) {
|
|
35
|
-
return interfaceName !== 'HmIP-RF';
|
|
36
|
-
}
|
|
37
29
|
/** A value that is certainly valid for this parameter, for a stored one that is not. */
|
|
38
30
|
export function fallbackValue(parameter) {
|
|
39
31
|
const candidates = [];
|
|
@@ -111,13 +103,12 @@ export class ConfigRepair {
|
|
|
111
103
|
done += 1;
|
|
112
104
|
this.#deps.onProgress({ done, total: targets.length, last: channel.write });
|
|
113
105
|
}
|
|
114
|
-
if (options.bidcosRecovery !== undefined &&
|
|
115
|
-
options.bidcosRecovery !== 'none' &&
|
|
116
|
-
options.dryRun !== true &&
|
|
117
|
-
supportsBidcosMaintenance(interfaceName)) {
|
|
106
|
+
if (options.bidcosRecovery !== undefined && options.bidcosRecovery !== 'none' && options.dryRun !== true) {
|
|
118
107
|
const method = options.bidcosRecovery === 'clearConfigCache' ? 'clearConfigCache' : 'restoreConfigToDevice';
|
|
119
|
-
await this.#deps.
|
|
120
|
-
|
|
108
|
+
if (await this.#deps.offers(interfaceName, method)) {
|
|
109
|
+
await this.#deps.write(interfaceName, method, [deviceAddress]);
|
|
110
|
+
result.bidcosRecovery = options.bidcosRecovery;
|
|
111
|
+
}
|
|
121
112
|
}
|
|
122
113
|
const after = options.dryRun === true ? before : await this.#configPending(interfaceName, deviceAddress);
|
|
123
114
|
if (after !== undefined) {
|
|
@@ -727,6 +727,12 @@ export interface BidcosInterfaceInfo {
|
|
|
727
727
|
export interface WriteOptions {
|
|
728
728
|
/** Send every writeable parameter, not only the changed ones (task 6, item 1). */
|
|
729
729
|
writeAll?: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* `paramset.putLink` only: send just the changed parameters of a link paramset. Without it a
|
|
732
|
+
* link paramset that has a change is written whole - every writable parameter as the interface
|
|
733
|
+
* returned it, the edits on top (task 113).
|
|
734
|
+
*/
|
|
735
|
+
changedOnly?: boolean;
|
|
730
736
|
/** Only validate and return what would be sent. */
|
|
731
737
|
dryRun?: boolean;
|
|
732
738
|
}
|
|
@@ -961,6 +967,15 @@ export interface ApiMethods {
|
|
|
961
967
|
params: [interfaceName?: string];
|
|
962
968
|
result: null;
|
|
963
969
|
};
|
|
970
|
+
/**
|
|
971
|
+
* Task 115: what the interface lists in `system.listMethods`, asked once per subscription;
|
|
972
|
+
* `null` when it gave no usable list. The device menu offers `restoreConfigToDevice` and
|
|
973
|
+
* `clearConfigCache` only where they are listed (`offersConfigMaintenance`).
|
|
974
|
+
*/
|
|
975
|
+
'interfaces.methodNames': {
|
|
976
|
+
params: [interfaceName: string];
|
|
977
|
+
result: string[] | null;
|
|
978
|
+
};
|
|
964
979
|
'rega.state': {
|
|
965
980
|
params: [];
|
|
966
981
|
result: RegaState;
|
|
@@ -50,6 +50,12 @@ export interface LinkProfile {
|
|
|
50
50
|
* dialog then shows every parameter.
|
|
51
51
|
*/
|
|
52
52
|
controls?: EasyControl[];
|
|
53
|
+
/**
|
|
54
|
+
* B-98: values an older WebUI wrote for a parameter of this profile (`LONG_PROFILE_ACTION_TYPE` 5
|
|
55
|
+
* of the shutter profiles before June 2026). Detection takes them only where no profile fits the
|
|
56
|
+
* link as the data has it; applying the profile keeps such a value where the link holds it.
|
|
57
|
+
*/
|
|
58
|
+
legacy?: Record<string, Array<number | string | boolean>>;
|
|
53
59
|
}
|
|
54
60
|
/**
|
|
55
61
|
* One control of the CCU easy mode's form of a profile (task 62). `requires` lists parameters the
|
|
@@ -123,7 +123,8 @@ export declare class EasyModeEngine {
|
|
|
123
123
|
/**
|
|
124
124
|
* The profiles a receiver channel type offers for a given sender channel type, expert first.
|
|
125
125
|
* Aliases are followed (`OPTICAL_SIGNAL_RECEIVER` -> `DIMMER_VIRTUAL_RECEIVER` -> `DIMMER`),
|
|
126
|
-
* and the expert profile is always present even when the data does not carry it.
|
|
126
|
+
* and the expert profile is always present even when the data does not carry it. B-98: where
|
|
127
|
+
* eQ-3 changed a profile, it also takes what the older WebUI wrote ({@link withLegacyValues}).
|
|
127
128
|
*/
|
|
128
129
|
profilesFor(receiverType: string, senderType: string): Promise<LinkProfile[]>;
|
|
129
130
|
/**
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* values for a delay or a level, and rules between parameters.
|
|
13
13
|
*/
|
|
14
14
|
import { parameterOrder } from '../paramset/description.js';
|
|
15
|
+
import { legacyProfile, withLegacyValues } from './legacyValues.js';
|
|
15
16
|
/** The parameter the CCU stores the chosen profile in, inside the receiver's LINK paramset. */
|
|
16
17
|
export const UI_HINT = 'UI_HINT';
|
|
17
18
|
/** Profile 0 is the expert view: no constraints, every parameter editable. */
|
|
@@ -92,13 +93,15 @@ export class EasyModeEngine {
|
|
|
92
93
|
/**
|
|
93
94
|
* The profiles a receiver channel type offers for a given sender channel type, expert first.
|
|
94
95
|
* Aliases are followed (`OPTICAL_SIGNAL_RECEIVER` -> `DIMMER_VIRTUAL_RECEIVER` -> `DIMMER`),
|
|
95
|
-
* and the expert profile is always present even when the data does not carry it.
|
|
96
|
+
* and the expert profile is always present even when the data does not carry it. B-98: where
|
|
97
|
+
* eQ-3 changed a profile, it also takes what the older WebUI wrote ({@link withLegacyValues}).
|
|
96
98
|
*/
|
|
97
99
|
async profilesFor(receiverType, senderType) {
|
|
98
100
|
const aliases = await this.#source.receiverTypeAliases();
|
|
99
101
|
const resolved = resolveAlias(receiverType, aliases);
|
|
100
102
|
const profiles = await this.#source.receiverProfiles(resolved);
|
|
101
|
-
|
|
103
|
+
// B-98: the values an older WebUI wrote, for detection where nothing else fits
|
|
104
|
+
const list = withLegacyValues(resolved, senderType, profiles?.senders[senderType] ?? []);
|
|
102
105
|
if (!list.some((profile) => profile.id === EXPERT_PROFILE_ID)) {
|
|
103
106
|
list.push(EXPERT_PROFILE);
|
|
104
107
|
}
|
|
@@ -127,7 +130,9 @@ export class EasyModeEngine {
|
|
|
127
130
|
const keepCurrent = options.keepCurrent ?? true;
|
|
128
131
|
const values = { ...current };
|
|
129
132
|
const problems = [];
|
|
130
|
-
|
|
133
|
+
// B-98: a value an older WebUI wrote stays where the link holds it
|
|
134
|
+
const params = keepCurrent ? legacyProfile(profile).params : profile.params;
|
|
135
|
+
for (const [param, constraint] of Object.entries(params)) {
|
|
131
136
|
if (!(param in description)) {
|
|
132
137
|
problems.push({
|
|
133
138
|
param,
|
|
@@ -181,10 +186,14 @@ export class EasyModeEngine {
|
|
|
181
186
|
return byHint;
|
|
182
187
|
}
|
|
183
188
|
// task 108: the first fitting profile by number, as `get_cur_profile2` breaks on its first match
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
189
|
+
const sorted = [...profiles].sort((a, b) => a.id - b.id);
|
|
190
|
+
const first = sorted.find((profile) => profile.id !== EXPERT_PROFILE_ID && profileFits(profile, linkParamset) !== undefined);
|
|
191
|
+
// B-98: only where nothing fits, a link an older WebUI made (`legacy` values)
|
|
192
|
+
const older = first ??
|
|
193
|
+
sorted.find((profile) => profile.id !== EXPERT_PROFILE_ID &&
|
|
194
|
+
profile.legacy !== undefined &&
|
|
195
|
+
profileFits(legacyProfile(profile), linkParamset) !== undefined);
|
|
196
|
+
return older ?? byHint;
|
|
188
197
|
}
|
|
189
198
|
/**
|
|
190
199
|
* The MASTER paramset of a channel type as the dialog should show it: ordered, with the
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* B-98: what the CCU's WebUI wrote for a profile before eQ-3 changed the profile, so that a link made
|
|
3
|
+
* with the older WebUI is still recognised.
|
|
4
|
+
*
|
|
5
|
+
* On 2026-06-22 eQ-3 changed the long press of the shutter and blind profiles (OpenCCU-Base
|
|
6
|
+
* `src/webui` commit `122e267b`, "Easymode parameter LONG_PROFILE_ACTION_TYPE for blind and jalousie
|
|
7
|
+
* actors changed"): `LONG_PROFILE_ACTION_TYPE` `5` (toggle, last direction) or `{5 1}` became `1`. The
|
|
8
|
+
* profile data follows the new WebUI, so a link a CCU made before - an HmIPW-DRBL4 run as a shutter
|
|
9
|
+
* with "auf / zu & hoch / herunter" holds `5` - fitted none of the profiles and showed as Expert.
|
|
10
|
+
*
|
|
11
|
+
* The profiles of exactly the files eQ-3 changed carry the old values as `legacy`. Detection takes
|
|
12
|
+
* them only where no profile fits the link as the data has it: the current WebUI shows an old
|
|
13
|
+
* "auf / zu & hoch / herunter" link as "Toggle", whose list still takes 5 and whose other presets
|
|
14
|
+
* are the same, and that stays so - but an old "auf / hoch", "zu / herunter" or "Position anfahren"
|
|
15
|
+
* link, which fits nothing, is recognised instead of falling back to Expert. Applying a profile
|
|
16
|
+
* keeps the old value where the link already holds it (nothing to write for a link left as the CCU
|
|
17
|
+
* made it) and writes the new one otherwise, as the current WebUI does.
|
|
18
|
+
*/
|
|
19
|
+
import type { LinkProfile } from '../data/types.js';
|
|
20
|
+
type LegacyValues = Readonly<Record<number, Readonly<Record<string, readonly number[]>>>>;
|
|
21
|
+
/** By receiver folder and sender file: the values the WebUI wrote before the change, per profile. */
|
|
22
|
+
export declare const LEGACY_PROFILE_VALUES: Readonly<Record<string, Readonly<Record<string, LegacyValues>>>>;
|
|
23
|
+
/** The profiles of one receiver folder and sender file, with what the older WebUI wrote as `legacy`. */
|
|
24
|
+
export declare function withLegacyValues(receiverFolder: string, senderFile: string, profiles: readonly LinkProfile[]): LinkProfile[];
|
|
25
|
+
/** A profile whose constraints also hold for its `legacy` values; the current value stays the default. */
|
|
26
|
+
export declare function legacyProfile(profile: LinkProfile): LinkProfile;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=legacyValues.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* B-98: what the CCU's WebUI wrote for a profile before eQ-3 changed the profile, so that a link made
|
|
3
|
+
* with the older WebUI is still recognised.
|
|
4
|
+
*
|
|
5
|
+
* On 2026-06-22 eQ-3 changed the long press of the shutter and blind profiles (OpenCCU-Base
|
|
6
|
+
* `src/webui` commit `122e267b`, "Easymode parameter LONG_PROFILE_ACTION_TYPE for blind and jalousie
|
|
7
|
+
* actors changed"): `LONG_PROFILE_ACTION_TYPE` `5` (toggle, last direction) or `{5 1}` became `1`. The
|
|
8
|
+
* profile data follows the new WebUI, so a link a CCU made before - an HmIPW-DRBL4 run as a shutter
|
|
9
|
+
* with "auf / zu & hoch / herunter" holds `5` - fitted none of the profiles and showed as Expert.
|
|
10
|
+
*
|
|
11
|
+
* The profiles of exactly the files eQ-3 changed carry the old values as `legacy`. Detection takes
|
|
12
|
+
* them only where no profile fits the link as the data has it: the current WebUI shows an old
|
|
13
|
+
* "auf / zu & hoch / herunter" link as "Toggle", whose list still takes 5 and whose other presets
|
|
14
|
+
* are the same, and that stays so - but an old "auf / hoch", "zu / herunter" or "Position anfahren"
|
|
15
|
+
* link, which fits nothing, is recognised instead of falling back to Expert. Applying a profile
|
|
16
|
+
* keeps the old value where the link already holds it (nothing to write for a link left as the CCU
|
|
17
|
+
* made it) and writes the new one otherwise, as the current WebUI does.
|
|
18
|
+
*/
|
|
19
|
+
const LONG_PROFILE_ACTION_TYPE = 'LONG_PROFILE_ACTION_TYPE';
|
|
20
|
+
/** SHUTTER_VIRTUAL_RECEIVER: profiles 1, 2, 4 wrote `{5 1}`, profile 3 wrote `5`. */
|
|
21
|
+
const SHUTTER = {
|
|
22
|
+
1: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] },
|
|
23
|
+
2: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] },
|
|
24
|
+
3: { [LONG_PROFILE_ACTION_TYPE]: [5] },
|
|
25
|
+
4: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] },
|
|
26
|
+
};
|
|
27
|
+
/** BLIND_VIRTUAL_RECEIVER: profile 3 wrote `5` or took `{1 5}` / `{5 1}`. */
|
|
28
|
+
const BLIND = { 3: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] } };
|
|
29
|
+
/** By receiver folder and sender file: the values the WebUI wrote before the change, per profile. */
|
|
30
|
+
export const LEGACY_PROFILE_VALUES = {
|
|
31
|
+
SHUTTER_VIRTUAL_RECEIVER: {
|
|
32
|
+
DISPLAY_INPUT_TRANSMITTER: SHUTTER,
|
|
33
|
+
DISPLAY_LEVEL_INPUT_TRANSMITTER: SHUTTER,
|
|
34
|
+
KEY_TRANSCEIVER: SHUTTER,
|
|
35
|
+
MULTI_MODE_INPUT_TRANSMITTER_1: SHUTTER,
|
|
36
|
+
MULTI_MODE_INPUT_TRANSMITTER_3: SHUTTER,
|
|
37
|
+
MULTI_MODE_INPUT_TRANSMITTER_4: SHUTTER,
|
|
38
|
+
},
|
|
39
|
+
BLIND_VIRTUAL_RECEIVER: {
|
|
40
|
+
DISPLAY_INPUT_TRANSMITTER: BLIND,
|
|
41
|
+
DISPLAY_LEVEL_INPUT_TRANSMITTER: BLIND,
|
|
42
|
+
KEY_TRANSCEIVER: BLIND,
|
|
43
|
+
MULTI_MODE_INPUT_TRANSMITTER_1: BLIND,
|
|
44
|
+
MULTI_MODE_INPUT_TRANSMITTER_3: BLIND,
|
|
45
|
+
MULTI_MODE_INPUT_TRANSMITTER_4: BLIND,
|
|
46
|
+
ROTARY_CONTROL_TRANSCEIVER_2: BLIND,
|
|
47
|
+
ROTARY_CONTROL_TRANSCEIVER_3: BLIND,
|
|
48
|
+
SWITCH_TRANSCEIVER: BLIND,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
/** The profiles of one receiver folder and sender file, with what the older WebUI wrote as `legacy`. */
|
|
52
|
+
export function withLegacyValues(receiverFolder, senderFile, profiles) {
|
|
53
|
+
const table = LEGACY_PROFILE_VALUES[receiverFolder]?.[senderFile];
|
|
54
|
+
if (!table) {
|
|
55
|
+
return [...profiles];
|
|
56
|
+
}
|
|
57
|
+
return profiles.map((profile) => {
|
|
58
|
+
const legacy = table[profile.id];
|
|
59
|
+
if (!legacy) {
|
|
60
|
+
return profile;
|
|
61
|
+
}
|
|
62
|
+
const entries = Object.entries(legacy).filter(([param]) => param in profile.params);
|
|
63
|
+
return entries.length === 0
|
|
64
|
+
? profile
|
|
65
|
+
: { ...profile, legacy: Object.fromEntries(entries.map(([param, values]) => [param, [...values]])) };
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** A profile whose constraints also hold for its `legacy` values; the current value stays the default. */
|
|
69
|
+
export function legacyProfile(profile) {
|
|
70
|
+
if (!profile.legacy) {
|
|
71
|
+
return profile;
|
|
72
|
+
}
|
|
73
|
+
const params = { ...profile.params };
|
|
74
|
+
for (const [param, values] of Object.entries(profile.legacy)) {
|
|
75
|
+
const constraint = params[param];
|
|
76
|
+
if (constraint) {
|
|
77
|
+
params[param] = widened(constraint, values);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { ...profile, params };
|
|
81
|
+
}
|
|
82
|
+
/** A constraint that also holds for the older WebUI's values; the current value stays the default. */
|
|
83
|
+
function widened(constraint, legacy) {
|
|
84
|
+
switch (constraint.kind) {
|
|
85
|
+
case 'fixed': {
|
|
86
|
+
const values = [constraint.value, ...legacy.filter((value) => value !== constraint.value)];
|
|
87
|
+
return { kind: 'list', values, default: constraint.value };
|
|
88
|
+
}
|
|
89
|
+
case 'list': {
|
|
90
|
+
const extra = legacy.filter((value) => !constraint.values.includes(value));
|
|
91
|
+
return extra.length === 0 ? constraint : { ...constraint, values: [...constraint.values, ...extra] };
|
|
92
|
+
}
|
|
93
|
+
case 'range':
|
|
94
|
+
return constraint;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=legacyValues.js.map
|