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.
Files changed (44) hide show
  1. package/data/cross-validations.json +14 -0
  2. package/data/easymode-time-selectors.json +1 -1
  3. package/data/manifest.json +12 -12
  4. package/data/master-forms.json +245 -24
  5. package/data/master-metadata.json +323 -9
  6. package/data/translations/de.json +12 -1
  7. package/data/translations/en.json +11 -0
  8. package/node_modules/@homematic-manager/backend/dist/api/backend.js +28 -5
  9. package/node_modules/@homematic-manager/backend/dist/rega/scripts.d.ts +12 -6
  10. package/node_modules/@homematic-manager/backend/dist/rega/scripts.js +17 -8
  11. package/node_modules/@homematic-manager/backend/dist/write/paramset.d.ts +10 -0
  12. package/node_modules/@homematic-manager/backend/dist/write/paramset.js +22 -1
  13. package/node_modules/@homematic-manager/backend/dist/write/repair.d.ts +7 -7
  14. package/node_modules/@homematic-manager/backend/dist/write/repair.js +5 -14
  15. package/node_modules/@homematic-manager/backend/package.json +1 -1
  16. package/node_modules/@homematic-manager/core/dist/api/types.d.ts +15 -0
  17. package/node_modules/@homematic-manager/core/dist/data/types.d.ts +6 -0
  18. package/node_modules/@homematic-manager/core/dist/easymodes/engine.d.ts +2 -1
  19. package/node_modules/@homematic-manager/core/dist/easymodes/engine.js +16 -7
  20. package/node_modules/@homematic-manager/core/dist/easymodes/legacyValues.d.ts +28 -0
  21. package/node_modules/@homematic-manager/core/dist/easymodes/legacyValues.js +97 -0
  22. package/node_modules/@homematic-manager/core/dist/easymodes/senderForms.d.ts +101 -0
  23. package/node_modules/@homematic-manager/core/dist/easymodes/senderForms.js +251 -0
  24. package/node_modules/@homematic-manager/core/dist/index.d.ts +4 -0
  25. package/node_modules/@homematic-manager/core/dist/index.js +4 -0
  26. package/node_modules/@homematic-manager/core/dist/interfaces/table.d.ts +14 -0
  27. package/node_modules/@homematic-manager/core/dist/interfaces/table.js +20 -0
  28. package/node_modules/@homematic-manager/core/dist/links/partnerFilter.d.ts +55 -0
  29. package/node_modules/@homematic-manager/core/dist/links/partnerFilter.js +235 -0
  30. package/node_modules/@homematic-manager/core/dist/paramset/cast.d.ts +37 -0
  31. package/node_modules/@homematic-manager/core/dist/paramset/cast.js +61 -1
  32. package/node_modules/@homematic-manager/core/dist/paramset/diff.d.ts +15 -0
  33. package/node_modules/@homematic-manager/core/dist/paramset/diff.js +16 -2
  34. package/node_modules/@homematic-manager/core/dist/paramset/powerMeter.d.ts +40 -0
  35. package/node_modules/@homematic-manager/core/dist/paramset/powerMeter.js +47 -0
  36. package/node_modules/@homematic-manager/core/dist/paramset/units.d.ts +11 -0
  37. package/node_modules/@homematic-manager/core/dist/paramset/units.js +19 -0
  38. package/node_modules/@homematic-manager/core/package.json +1 -1
  39. package/package.json +4 -4
  40. package/ui/assets/index-BGYochtr.js +21 -0
  41. package/ui/assets/index-Cd-Vx9ge.css +1 -0
  42. package/ui/index.html +2 -2
  43. package/ui/assets/index-D94DHu87.css +0 -1
  44. package/ui/assets/index-j1HvLwHX.js +0 -21
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Task 109: the forms the CCU's WebUI draws for the *sender* side of a link.
3
+ *
4
+ * `ic_setprofiles.cgi` sources `easymodes/<paramid>.tcl` for the sender part of a link, the id being
5
+ * `getParamsetId(<sender>, LINK)`. For almost every sender that file does not exist, or is only a
6
+ * receiver folder's dispatcher, and the sender's LINK parameters - where it has any - are shown raw.
7
+ * Three old BidCos sensors have a form of their own:
8
+ *
9
+ * - `ks550_ch_link` (KS550, HM-WDS100-C6-O) and `wds100_ch_link` (HM-WDS100-C6-O-2): the weather
10
+ * station's storm thresholds, a profile "Sturmschwelle" with the switch-on and switch-off threshold
11
+ * as a Beaufort scale; the HM-WDS100-C6-O-2 copies them into the receiver's `SHORT_COND_VALUE_HI` /
12
+ * `SHORT_COND_VALUE_LO`. Hidden when the receiver is a combination sensor (`WS_CS`).
13
+ * - `wa_od_ch_link` (HM-Sen-Wa-Od, the capacitive filling level sensor): no profile, the upper and
14
+ * lower fill level as a percentage (the raw value is twice it), each switchable off (255).
15
+ *
16
+ * The tables are the WebUI's (`www/config/easymodes`); `data/extracted/easymode_links.json`'s
17
+ * `senders` and `weatherTexts` are extracted from it by `data/scripts/easymode-links.mjs`, and
18
+ * `senderForms.test.ts` fails where this module differs from the extract.
19
+ */
20
+ import type { Paramset, ParamsetValue } from '../rpc/values.js';
21
+ /** A localised text of the forms: German and English, as the WebUI has them. */
22
+ export interface SenderText {
23
+ readonly de: string;
24
+ readonly en: string;
25
+ }
26
+ /** One entry of a threshold select: the raw value and its Beaufort grade. */
27
+ export interface StormOption {
28
+ readonly value: number;
29
+ /** The Beaufort grade, 0-12 - the index into {@link WIND_FORCE} and {@link WIND_DESCRIPTION}. */
30
+ readonly force: number;
31
+ }
32
+ export interface StormForm {
33
+ readonly kind: 'storm';
34
+ readonly paramsetId: string;
35
+ /** The values the profile "Sturmschwelle" takes for both thresholds (`set range {…}`). */
36
+ readonly range: readonly number[];
37
+ /** What the selects offer, by device type (the HM-WDS100-C6-O-2 has 20 where the others have 25). */
38
+ readonly options: (senderDeviceType: string) => readonly StormOption[];
39
+ /** The receiver parameters the thresholds are copied into, for this sender device type. */
40
+ readonly mirrors: (senderDeviceType: string) => Readonly<Record<string, string>>;
41
+ }
42
+ export interface FillLevelForm {
43
+ readonly kind: 'fillLevel';
44
+ readonly paramsetId: string;
45
+ /** The raw value of a threshold that is switched off. */
46
+ readonly inactive: number;
47
+ /** Raw value per percent: the WebUI shows `100 / (200 / raw)`. */
48
+ readonly perPercent: number;
49
+ }
50
+ export type SenderForm = StormForm | FillLevelForm;
51
+ /** The profile ids of the storm form: the expert view and "Sturmschwelle". */
52
+ export declare const STORM_EXPERT = 0;
53
+ export declare const STORM_THRESHOLD = 1;
54
+ export declare const SENDER_FORMS: Readonly<Record<string, SenderForm>>;
55
+ /** Receivers for which the storm form hides itself ("bei Verknüpfung Wetterstation - Kombisensor sinnlos"). */
56
+ export declare const STORM_HIDDEN_FOR_RECEIVER = "WS_CS";
57
+ /**
58
+ * The sender form of a link: the one the sender's LINK paramset id names, unless that form hides
59
+ * itself for this receiver. `undefined` shows the sender's parameters raw, as before.
60
+ */
61
+ export declare function senderFormFor(paramsetId: string, receiverType: string): SenderForm | undefined;
62
+ /**
63
+ * The profile of a storm form a link follows, as `get_cur_profile2` decides it: "Sturmschwelle"
64
+ * when both thresholds hold one of its values (`PEER_NEEDS_BURST` takes either), the expert view
65
+ * otherwise - a fresh link's thresholds are 0.
66
+ */
67
+ export declare function stormProfile(form: StormForm, values: Paramset): number;
68
+ /**
69
+ * What choosing "Sturmschwelle" writes: the thresholds stay where they already hold a value of the
70
+ * profile, otherwise the first one (the WebUI's select starts on it).
71
+ */
72
+ export declare function applyStormProfile(form: StormForm, values: Paramset): Record<string, number>;
73
+ /**
74
+ * The fill level of a raw threshold as the WebUI shows it: `100 / (200 / raw)` rounded to .0 or .5
75
+ * (`setDecimalPlaces`), and whether the threshold is on at all.
76
+ */
77
+ export declare function fillLevelPercent(form: FillLevelForm, raw: ParamsetValue | undefined): {
78
+ percent: number;
79
+ active: boolean;
80
+ };
81
+ /** The raw threshold of a percentage (0-100, to .0 or .5), or the inactive value. */
82
+ export declare function fillLevelRaw(form: FillLevelForm, percent: number, active: boolean): number;
83
+ /**
84
+ * `isLowerGTUpper` of the WebUI's fill level form: the lower threshold stays 5 % below the upper
85
+ * one. A lower one at or above the upper pushes the upper up (unless that is off); an upper one at
86
+ * or below the lower pulls the lower down; the lower never below 0, the upper never above 100.
87
+ * Percentages; `undefined` for a threshold that is off.
88
+ */
89
+ export declare function adjustFillLevels(changed: 'upper' | 'lower', upper: number | undefined, lower: number | undefined): {
90
+ upper: number | undefined;
91
+ lower: number | undefined;
92
+ };
93
+ /** The weather forms' texts (`WEATHER/localization/lang.js`). */
94
+ export declare const STORM_TEXTS: Readonly<Record<string, SenderText>>;
95
+ /** The names of the storm form's profiles (`PROFILES_MAP`): the expert view and "Sturmschwelle". */
96
+ export declare const STORM_PROFILE_NAMES: Readonly<Record<number, SenderText>>;
97
+ /** The Beaufort grades' names, 0-12. */
98
+ export declare const WIND_FORCE: readonly SenderText[];
99
+ /** What each grade looks like outside, 0-12. */
100
+ export declare const WIND_DESCRIPTION: readonly SenderText[];
101
+ //# sourceMappingURL=senderForms.d.ts.map
@@ -0,0 +1,251 @@
1
+ /**
2
+ * Task 109: the forms the CCU's WebUI draws for the *sender* side of a link.
3
+ *
4
+ * `ic_setprofiles.cgi` sources `easymodes/<paramid>.tcl` for the sender part of a link, the id being
5
+ * `getParamsetId(<sender>, LINK)`. For almost every sender that file does not exist, or is only a
6
+ * receiver folder's dispatcher, and the sender's LINK parameters - where it has any - are shown raw.
7
+ * Three old BidCos sensors have a form of their own:
8
+ *
9
+ * - `ks550_ch_link` (KS550, HM-WDS100-C6-O) and `wds100_ch_link` (HM-WDS100-C6-O-2): the weather
10
+ * station's storm thresholds, a profile "Sturmschwelle" with the switch-on and switch-off threshold
11
+ * as a Beaufort scale; the HM-WDS100-C6-O-2 copies them into the receiver's `SHORT_COND_VALUE_HI` /
12
+ * `SHORT_COND_VALUE_LO`. Hidden when the receiver is a combination sensor (`WS_CS`).
13
+ * - `wa_od_ch_link` (HM-Sen-Wa-Od, the capacitive filling level sensor): no profile, the upper and
14
+ * lower fill level as a percentage (the raw value is twice it), each switchable off (255).
15
+ *
16
+ * The tables are the WebUI's (`www/config/easymodes`); `data/extracted/easymode_links.json`'s
17
+ * `senders` and `weatherTexts` are extracted from it by `data/scripts/easymode-links.mjs`, and
18
+ * `senderForms.test.ts` fails where this module differs from the extract.
19
+ */
20
+ /** The profile ids of the storm form: the expert view and "Sturmschwelle". */
21
+ export const STORM_EXPERT = 0;
22
+ export const STORM_THRESHOLD = 1;
23
+ const STORM_THRESHOLDS = ['STORM_UPPER_THRESHOLD', 'STORM_LOWER_THRESHOLD'];
24
+ /** The Beaufort options of the KS550 form: raw value -> grade. */
25
+ const KS550_OPTIONS = [
26
+ [1, 0],
27
+ [2, 1],
28
+ [5, 2],
29
+ [12, 3],
30
+ [25, 4],
31
+ [29, 5],
32
+ [39, 6],
33
+ [50, 7],
34
+ [62, 8],
35
+ [75, 9],
36
+ [89, 10],
37
+ [103, 11],
38
+ [118, 12],
39
+ ].map(([value, force]) => ({ value: value ?? 0, force: force ?? 0 }));
40
+ const WDS100_2 = 'HM-WDS100-C6-O-2';
41
+ export const SENDER_FORMS = {
42
+ ks550_ch_link: {
43
+ kind: 'storm',
44
+ paramsetId: 'ks550_ch_link',
45
+ range: [1, 2, 5, 12, 15, 25, 29, 39, 50, 62, 75, 89, 103, 118],
46
+ options: () => KS550_OPTIONS,
47
+ mirrors: () => ({}),
48
+ },
49
+ wds100_ch_link: {
50
+ kind: 'storm',
51
+ paramsetId: 'wds100_ch_link',
52
+ range: [1, 2, 5, 12, 15, 20, 25, 29, 39, 50, 62, 75, 89, 103, 118],
53
+ // `[string first "HM-WDS100-C6-O-2" $SENDER] == 0`: grade 4 is 20 on that one, 25 otherwise
54
+ options: (deviceType) => deviceType.startsWith(WDS100_2)
55
+ ? KS550_OPTIONS.map((option) => (option.value === 25 ? { value: 20, force: option.force } : option))
56
+ : KS550_OPTIONS,
57
+ mirrors: (deviceType) => deviceType === WDS100_2
58
+ ? { STORM_UPPER_THRESHOLD: 'SHORT_COND_VALUE_HI', STORM_LOWER_THRESHOLD: 'SHORT_COND_VALUE_LO' }
59
+ : {},
60
+ },
61
+ wa_od_ch_link: { kind: 'fillLevel', paramsetId: 'wa_od_ch_link', inactive: 255, perPercent: 2 },
62
+ };
63
+ /** Receivers for which the storm form hides itself ("bei Verknüpfung Wetterstation - Kombisensor sinnlos"). */
64
+ export const STORM_HIDDEN_FOR_RECEIVER = 'WS_CS';
65
+ /**
66
+ * The sender form of a link: the one the sender's LINK paramset id names, unless that form hides
67
+ * itself for this receiver. `undefined` shows the sender's parameters raw, as before.
68
+ */
69
+ export function senderFormFor(paramsetId, receiverType) {
70
+ const form = SENDER_FORMS[paramsetId];
71
+ if (form?.kind === 'storm' && receiverType === STORM_HIDDEN_FOR_RECEIVER) {
72
+ return undefined;
73
+ }
74
+ return form;
75
+ }
76
+ const asNumber = (value) => (typeof value === 'number' ? value : Number(value));
77
+ /**
78
+ * The profile of a storm form a link follows, as `get_cur_profile2` decides it: "Sturmschwelle"
79
+ * when both thresholds hold one of its values (`PEER_NEEDS_BURST` takes either), the expert view
80
+ * otherwise - a fresh link's thresholds are 0.
81
+ */
82
+ export function stormProfile(form, values) {
83
+ const fits = STORM_THRESHOLDS.every((name) => form.range.includes(asNumber(values[name])));
84
+ return fits ? STORM_THRESHOLD : STORM_EXPERT;
85
+ }
86
+ /**
87
+ * What choosing "Sturmschwelle" writes: the thresholds stay where they already hold a value of the
88
+ * profile, otherwise the first one (the WebUI's select starts on it).
89
+ */
90
+ export function applyStormProfile(form, values) {
91
+ const result = {};
92
+ for (const name of STORM_THRESHOLDS) {
93
+ if (!(name in values))
94
+ continue;
95
+ const current = asNumber(values[name]);
96
+ result[name] = form.range.includes(current) ? current : (form.range[0] ?? 0);
97
+ }
98
+ return result;
99
+ }
100
+ /**
101
+ * The fill level of a raw threshold as the WebUI shows it: `100 / (200 / raw)` rounded to .0 or .5
102
+ * (`setDecimalPlaces`), and whether the threshold is on at all.
103
+ */
104
+ export function fillLevelPercent(form, raw) {
105
+ const value = asNumber(raw);
106
+ if (value === form.inactive) {
107
+ return { percent: 0, active: false };
108
+ }
109
+ if (!Number.isFinite(value) || value <= 0) {
110
+ return { percent: 0, active: true };
111
+ }
112
+ return { percent: roundHalf(value / form.perPercent), active: true };
113
+ }
114
+ /** The raw threshold of a percentage (0-100, to .0 or .5), or the inactive value. */
115
+ export function fillLevelRaw(form, percent, active) {
116
+ if (!active) {
117
+ return form.inactive;
118
+ }
119
+ const clamped = Math.min(100, Math.max(0, Number.isFinite(percent) ? percent : 0));
120
+ return Math.round(roundHalf(clamped) * form.perPercent);
121
+ }
122
+ /** `setDecimalPlaces`: one decimal, then .1-.2 down to .0, .3-.7 to .5, .8-.9 up to the next whole. */
123
+ function roundHalf(value) {
124
+ const tenths = Math.round(value * 10);
125
+ const whole = Math.floor(tenths / 10);
126
+ const decimal = tenths - whole * 10;
127
+ if (decimal === 0)
128
+ return whole;
129
+ if (decimal <= 2)
130
+ return whole;
131
+ if (decimal <= 7)
132
+ return whole + 0.5;
133
+ return whole + 1;
134
+ }
135
+ /**
136
+ * `isLowerGTUpper` of the WebUI's fill level form: the lower threshold stays 5 % below the upper
137
+ * one. A lower one at or above the upper pushes the upper up (unless that is off); an upper one at
138
+ * or below the lower pulls the lower down; the lower never below 0, the upper never above 100.
139
+ * Percentages; `undefined` for a threshold that is off.
140
+ */
141
+ export function adjustFillLevels(changed, upper, lower) {
142
+ let up = upper;
143
+ let low = lower;
144
+ if (changed === 'lower') {
145
+ if (low !== undefined && up !== undefined && low >= up) {
146
+ up = low + 5;
147
+ }
148
+ }
149
+ else {
150
+ if (up !== undefined && low !== undefined && up <= low) {
151
+ low = up - 5;
152
+ }
153
+ if (low !== undefined && low < 0) {
154
+ low = 0;
155
+ if (up !== undefined)
156
+ up = 5;
157
+ }
158
+ if (up !== undefined && up > 100) {
159
+ up = 100;
160
+ if (low !== undefined)
161
+ low = 95;
162
+ }
163
+ }
164
+ return { upper: up, lower: low };
165
+ }
166
+ /** The weather forms' texts (`WEATHER/localization/lang.js`). */
167
+ export const STORM_TEXTS = {
168
+ weatherProfile1: { de: 'Sturmschwelle', en: 'Storm threshold' },
169
+ windInBeaufort: { de: 'Windstärke in Beaufort', en: 'Wind strength in Beaufort scale' },
170
+ upperStormThreshold: { de: 'Einschaltschwelle', en: 'Switch-on threshold' },
171
+ lowerStormThreshold: { de: 'Ausschaltschwelle', en: 'Switch-off threshold' },
172
+ toolTip0: {
173
+ de: 'Schaltbefehl bei überschreiten der eingestellten Schaltschwelle',
174
+ en: 'Switching command on exceeding the set threshold',
175
+ },
176
+ toolTip1: {
177
+ de: 'Schaltbefehl bei Unterschreiten der eingestellten Schaltschwelle',
178
+ en: 'Switching command on fall below the set threshold',
179
+ },
180
+ };
181
+ /** The names of the storm form's profiles (`PROFILES_MAP`): the expert view and "Sturmschwelle". */
182
+ export const STORM_PROFILE_NAMES = {
183
+ [STORM_EXPERT]: { de: 'Experte', en: 'Expert' },
184
+ [STORM_THRESHOLD]: { de: 'Sturmschwelle', en: 'Storm threshold' },
185
+ };
186
+ /** The Beaufort grades' names, 0-12. */
187
+ export const WIND_FORCE = [
188
+ { de: 'Windstärke 0 - Windstille', en: 'Wind strength 0 - Calm' },
189
+ { de: 'Windstärke 1 - leiser Zug', en: 'Wind strength 1 - Light air' },
190
+ { de: 'Windstärke 2 - leichte Brise', en: 'Wind strength 2 - Light breeze' },
191
+ { de: 'Windstärke 3 - schwache Brise', en: 'Wind strength 3 - Gentle breeze' },
192
+ { de: 'Windstärke 4 - mäßige Brise', en: 'Wind strength 4 - Moderate breeze' },
193
+ { de: 'Windstärke 5 - frischer Wind', en: 'Wind strength 5 - Fresh breeze' },
194
+ { de: 'Windstärke 6 - starker Wind', en: 'Wind strength 6 - Strong breeze' },
195
+ { de: 'Windstärke 7 - steifer Wind', en: 'Wind strength 7 - High wind, moderate gale, near gale' },
196
+ { de: 'Windstärke 8 - stürmischer Wind', en: 'Wind strength 8 - Gale, fresh gale' },
197
+ { de: 'Windstärke 9 - Sturm', en: 'Wind strength 9 - Strong gale' },
198
+ { de: 'Windstärke 10 - schwerer Sturm', en: 'Wind strength 10 - Strom, whole gale' },
199
+ { de: 'Windstärke 11 - orkanartiger Sturm', en: 'Wind strength 11 - Violent storm' },
200
+ { de: 'Windstärke 12 - Orkan', en: 'Wind strength 12 - Hurricane force' },
201
+ ];
202
+ /** What each grade looks like outside, 0-12. */
203
+ export const WIND_DESCRIPTION = [
204
+ { de: 'Keine Luftbewegung, Rauch steigt senkrecht empor.', en: 'Calm, smoke rises vertically.' },
205
+ {
206
+ de: 'Kaum merklich, Rauch treibt leicht ab, Windflügel und Windfahnen unbewegt.',
207
+ en: 'Smoke drift indicates wind direction, still wind vanes.',
208
+ },
209
+ { de: 'Blätter rascheln, Wind im Gesicht spürbar.', en: 'Leaves rustle, wind felt on face.' },
210
+ {
211
+ de: 'Blätter und dünne Zweige bewegen sich, Wimpel werden gestreckt.',
212
+ en: 'Leaves and small twigs constantly moving, light flags extended',
213
+ },
214
+ {
215
+ de: 'Zweige bewegen sich, loses Papier wird vom Boden gehoben.',
216
+ en: 'Leaves and loose paper lifted, small tree branches move',
217
+ },
218
+ {
219
+ de: 'Größere Zweige und Bäume bewegen sich, Wind deutlich hörbar.',
220
+ en: 'Larger tree branches and trees begin to sway, wind noticeable',
221
+ },
222
+ {
223
+ de: 'Dicke Äste bewegen sich, hörbares Pfeifen an Drahtseilen und Telefonleitungen.',
224
+ en: 'Larger tree branches moving, whistling in wires',
225
+ },
226
+ {
227
+ de: 'Bäume schwanken, Widerstand beim Gehen gegen den Wind.',
228
+ en: 'Whole trees moving, resistance felt walking against wind',
229
+ },
230
+ {
231
+ de: 'Grosse Bäume werden bewegt, Zweige brechen von Bäumen, erhebliche Behinderung beim Gehen.',
232
+ en: 'Larger tress moving, twigs breaking off trees, generally impedes progress',
233
+ },
234
+ {
235
+ de: 'Äste brechen, kleinere Schäden an Häusern, Ziegel werden von Dächern abgehoben, Gartenmöbel werden umgeworfen und verweht.',
236
+ en: 'Branches breaking off trees, slight damages on houses, slate blows off roofs',
237
+ },
238
+ {
239
+ de: 'Bäume werden entwurzelt, Baumstämme brechen, grössere Schäden an Häusern.',
240
+ en: 'Trees broken or uprooted, considerable damages on houses',
241
+ },
242
+ {
243
+ de: 'Heftige Böen, schwere Sturmschäden, schwere Waldschäden, Dächer werden abgedeckt, Autos werden aus der Spur geworfen. Selten im Landesinneren.',
244
+ en: 'Extreme destruction, forests flattened, shingles are blown off of roofs, devastation, cars thrown. Seldom experienced on inland',
245
+ },
246
+ {
247
+ de: 'Schwerste Sturmschäden und Verwüstungen. Selten im Landesinneren.',
248
+ en: 'Heavy storm damages and destructions. Seldom experienced on inland',
249
+ },
250
+ ];
251
+ //# sourceMappingURL=senderForms.js.map
@@ -18,6 +18,7 @@ export * from './devices/index.js';
18
18
  export * from './devices/smokeGroups.js';
19
19
  export * from './devices/hmipKey.js';
20
20
  export * from './links/roles.js';
21
+ export * from './links/partnerFilter.js';
21
22
  export * from './rpc/values.js';
22
23
  export * from './rpc/methods.js';
23
24
  export * from './rpc/text.js';
@@ -28,9 +29,12 @@ export * from './paramset/cast.js';
28
29
  export * from './paramset/validate.js';
29
30
  export * from './paramset/diff.js';
30
31
  export * from './paramset/multiApply.js';
32
+ export * from './paramset/powerMeter.js';
31
33
  export * from './easymodes/engine.js';
32
34
  export * from './easymodes/form.js';
33
35
  export * from './easymodes/linkTypes.js';
36
+ export * from './easymodes/legacyValues.js';
37
+ export * from './easymodes/senderForms.js';
34
38
  export * from './serviceMessages/index.js';
35
39
  export * from './rssi/index.js';
36
40
  export * from './events/ringBuffer.js';
@@ -20,6 +20,7 @@ export * from './devices/index.js';
20
20
  export * from './devices/smokeGroups.js';
21
21
  export * from './devices/hmipKey.js';
22
22
  export * from './links/roles.js';
23
+ export * from './links/partnerFilter.js';
23
24
  // Values and the write path (task 6)
24
25
  export * from './rpc/values.js';
25
26
  export * from './rpc/methods.js';
@@ -31,10 +32,13 @@ export * from './paramset/cast.js';
31
32
  export * from './paramset/validate.js';
32
33
  export * from './paramset/diff.js';
33
34
  export * from './paramset/multiApply.js';
35
+ export * from './paramset/powerMeter.js';
34
36
  // Easy modes and the MASTER metadata layer
35
37
  export * from './easymodes/engine.js';
36
38
  export * from './easymodes/form.js';
37
39
  export * from './easymodes/linkTypes.js';
40
+ export * from './easymodes/legacyValues.js';
41
+ export * from './easymodes/senderForms.js';
38
42
  // State the tabs show
39
43
  export * from './serviceMessages/index.js';
40
44
  export * from './rssi/index.js';
@@ -225,6 +225,20 @@ export declare function interfaceDefinition(name: string): InterfaceDefinition |
225
225
  * type that is not known yet get the pairing dialog, and the process behind them has the last word.
226
226
  */
227
227
  export declare function canPairDevices(type: string): boolean;
228
+ /** The two BidCos maintenance calls of the device menu and the repair dialog (task 115). */
229
+ export type ConfigMaintenanceMethod = 'restoreConfigToDevice' | 'clearConfigCache';
230
+ /**
231
+ * Task 115: may `restoreConfigToDevice` or `clearConfigCache` be offered for this interface?
232
+ *
233
+ * - hmipserver lists both in `system.listMethods` and answers `-1 Generic error` to every call, so
234
+ * an HmIP interface never offers them, whatever its list says.
235
+ * - Elsewhere the interface's own `system.listMethods` decides, as the CCU WebUI's rule does since
236
+ * OpenCCU-Base restricted the button to the processes that have the method: hs485d of an eQ-3
237
+ * CCU3 has neither, rfd and openccu-lite's hs485d have both.
238
+ * - Without a usable list (`undefined`: the process has no `system.listMethods`, or it failed) the
239
+ * type decides as before: BidCos interfaces only.
240
+ */
241
+ export declare function offersConfigMaintenance(name: string, type: string, method: ConfigMaintenanceMethod, listed: readonly string[] | ReadonlySet<string> | undefined): boolean;
228
242
  /**
229
243
  * The identity string passed to `init(url, ident)` and sent back with every callback, which is how
230
244
  * the callback server tells the interfaces apart. `hmm_<name>` for everything except CUxD, which
@@ -113,6 +113,26 @@ export function interfaceDefinition(name) {
113
113
  export function canPairDevices(type) {
114
114
  return interfaceDefinition(type)?.installMode !== false;
115
115
  }
116
+ /**
117
+ * Task 115: may `restoreConfigToDevice` or `clearConfigCache` be offered for this interface?
118
+ *
119
+ * - hmipserver lists both in `system.listMethods` and answers `-1 Generic error` to every call, so
120
+ * an HmIP interface never offers them, whatever its list says.
121
+ * - Elsewhere the interface's own `system.listMethods` decides, as the CCU WebUI's rule does since
122
+ * OpenCCU-Base restricted the button to the processes that have the method: hs485d of an eQ-3
123
+ * CCU3 has neither, rfd and openccu-lite's hs485d have both.
124
+ * - Without a usable list (`undefined`: the process has no `system.listMethods`, or it failed) the
125
+ * type decides as before: BidCos interfaces only.
126
+ */
127
+ export function offersConfigMaintenance(name, type, method, listed) {
128
+ if (/hmip/i.test(name) || /hmip/i.test(type)) {
129
+ return false;
130
+ }
131
+ if (listed === undefined) {
132
+ return type.startsWith('BidCos') || (type === '' && name.startsWith('BidCos'));
133
+ }
134
+ return 'has' in listed ? listed.has(method) : listed.includes(method);
135
+ }
116
136
  /**
117
137
  * The identity string passed to `init(url, ident)` and sent back with every callback, which is how
118
138
  * the callback server tells the interfaces apart. `hmm_<name>` for everything except CUxD, which
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Which channels the "create link" dialog offers, beyond the role matrix.
3
+ *
4
+ * The roles (`roles.ts`) say which channels *can* be linked. The CCU's WebUI offers fewer: its
5
+ * channel list for a new link (`ic_selchannel.cgi`, `showHmIPChannel` and `linkIsExpertChannel`,
6
+ * read at OpenCCU 3.89.13) leaves out channels a link makes no sense for or must not be made
7
+ * with - a plug's own button as the sender of a link to another device, the channels a light
8
+ * controller does not use in its mode, the second and third virtual channel of every actuator
9
+ * channel. This module is those rules as data and a few predicates, so the dialog can offer what
10
+ * the CCU offers and still show everything on request.
11
+ *
12
+ * Pure: the rules that depend on how a device is set up need a MASTER paramset, and the caller
13
+ * reads those ({@link linkFilterMasters} says which) and hands them in. A paramset that was not
14
+ * read hides nothing - an unknown mode shows the channel, as the WebUI's rules fall through.
15
+ *
16
+ * Not ported: the display channels of the wall-mount glass displays (`*-WGD`, `*-WGD-PL`). The
17
+ * WebUI picks them by the order of the screens, which it keeps in ReGa's metadata of the device
18
+ * and nowhere on the device itself; there is nothing to read it from on a system without ReGa.
19
+ */
20
+ import { type DeviceDescription, type DeviceIndex } from '../devices/index.js';
21
+ import type { Paramset } from '../rpc/values.js';
22
+ /** Why a channel is not offered. */
23
+ export type LinkChannelHiddenReason =
24
+ /** The device's own key or sensor channel: linked inside the device, not offered to others. */
25
+ 'internal-sender'
26
+ /** A channel type no link is made with (the week program, an unused key, the KWL controller). */
27
+ | 'not-for-links'
28
+ /** Not in use in the mode or layout the device is set to. */
29
+ | 'device-mode'
30
+ /** The second and third virtual channel of an actuator channel, and the like: expert channels. */
31
+ | 'expert'
32
+ /** The interface marks the channel invisible (`FLAGS` without bit 0). */
33
+ | 'invisible';
34
+ /** The MASTER paramsets the rules were given, by address. */
35
+ export type LinkFilterMasters = ReadonlyMap<string, Paramset>;
36
+ /**
37
+ * Every channel of the interface the WebUI would not offer for a new link, with the reason.
38
+ *
39
+ * The order of the rules is the WebUI's: the device's own senders, the channel types never linked,
40
+ * the device's mode, the expert channels, and last the interface's own "invisible" flag.
41
+ */
42
+ export declare function hiddenLinkChannels(index: DeviceIndex, masters?: LinkFilterMasters): Map<string, LinkChannelHiddenReason>;
43
+ /**
44
+ * The MASTER paramsets {@link hiddenLinkChannels} needs to decide the mode rules: the maintenance
45
+ * channel of an HmIP-RGBW and of the glass switches, and every channel of a DALI gateway. Only
46
+ * for channels that take part in links at all; empty on an interface without such devices.
47
+ */
48
+ export declare function linkFilterMasters(index: DeviceIndex): string[];
49
+ /**
50
+ * A pair the WebUI does not offer although the roles match: a radiator thermostat's own
51
+ * `CLIMATECONTROL_RT_RECEIVER` as the receiver of its own sender channel. The two halves of an
52
+ * HM-CC-RT-DN are meant for the same channels of *other* thermostats.
53
+ */
54
+ export declare function isSameDeviceClimatePair(sender: DeviceDescription, receiver: DeviceDescription): boolean;
55
+ //# sourceMappingURL=partnerFilter.d.ts.map