iobroker.eos-admin 9.0.27 → 9.0.28
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/NEXOWATT_EOS_BUILD_INFO.json +9 -12
- package/README.md +17 -227
- package/adminWww/.vite/manifest.json +224 -233
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13887 -13897
- package/adminWww/assets/{AdapterUpdateDialog-L3aqW3ID.js → AdapterUpdateDialog-DBLX7GoO.js} +5 -5
- package/adminWww/assets/{Adapters-Db3kbmAj.js → Adapters-c250DTTU.js} +5 -5
- package/adminWww/assets/AddLink-0L0E-LsA.js +1 -0
- package/adminWww/assets/ColorLens-DA51K29x.js +1 -0
- package/adminWww/assets/ConfigManager-BBUXk8hZ.js +1 -0
- package/adminWww/assets/Enums-CWJJ2zNF.js +92 -0
- package/adminWww/assets/Fields-CNefAzNH.js +1 -0
- package/adminWww/assets/FileCopy-B16lEuur.js +1 -0
- package/adminWww/assets/Files-Bf8oZSk6.js +1 -0
- package/adminWww/assets/{Hosts-DimiJ78g.js → Hosts-8gg41ODb.js} +6 -6
- package/adminWww/assets/Instances-PPTEPJQN.js +4 -0
- package/adminWww/assets/Intro-9c_ynpJu.js +2 -0
- package/adminWww/assets/Lens-9lkeoWGk.js +1 -0
- package/adminWww/assets/LinearScale-Be5h2beh.js +1 -0
- package/adminWww/assets/{Logs-D9dqF5Ag.js → Logs-Brgb9kR_.js} +2 -2
- package/adminWww/assets/North-C2whbHM-.js +1 -0
- package/adminWww/assets/{Objects-oliB7_Se.js → Objects-DHVNfs_x.js} +4 -4
- package/adminWww/assets/Overview-CgnpH8e8.js +3 -0
- package/adminWww/assets/PersonOff-DqBq0Fho.js +1 -0
- package/adminWww/assets/PlaylistAdd-O8k92YBd.js +1 -0
- package/adminWww/assets/State-vVobamei.js +1 -0
- package/adminWww/assets/UsedResources-1fEUqiQ6.js +2 -0
- package/adminWww/assets/Users-oRpvFtQR.js +1 -0
- package/adminWww/assets/{bootstrap-BVw0diuj.js → bootstrap-st8VxLDc.js} +25 -25
- package/adminWww/assets/date-fns-C1dqkno9.js +1 -0
- package/adminWww/assets/{hostInit-C_7OBoza.js → hostInit-OQMl4yOT.js} +1 -1
- package/adminWww/assets/icons-material-DeF0gQyK.js +1 -0
- package/adminWww/assets/{index-DwDSxDMx.js → index-D4lV2S7J.js} +2 -2
- package/adminWww/assets/{installSVGRenderer--VTzKbml.js → installSVGRenderer-1WdbDz-H.js} +1 -1
- package/adminWww/assets/isSameWeek-Crh37s7U.js +1 -0
- package/adminWww/assets/isWithinInterval-Bo1WiDfq.js +1 -0
- package/adminWww/assets/locale-hLcz_Xh2.js +1 -0
- package/adminWww/assets/{mf-entry-bootstrap-0-6f3e4c6b.js → mf-entry-bootstrap-0-3b253ab0.js} +2 -2
- package/adminWww/assets/sentry-DwQQLI7N.js +1 -0
- package/adminWww/assets/startOfWeek-DJph8SIW.js +1 -0
- package/adminWww/index.html +23 -23
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/remoteEntry-eos-9.0.28.js +12 -0
- package/adminWww/remoteEntry.js +1 -1
- package/docs/DOKUMENTATION_9.0.27.md +7 -0
- package/docs/README.md +13 -0
- package/docs/UMSORTIERTE_DATEIEN.tsv +153 -0
- package/docs/reports/unified-9.0.14/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.16/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.17/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.18/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.21/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.22/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.28/PRUEFBERICHT.md +40 -0
- package/docs/reports/unified-9.0.28/PRUEFERGEBNISSE.json +112 -0
- package/docs/reports/unified-9.0.28/raw/INDEX.json +87 -0
- package/docs/reports/unified-9.0.28/raw/backend.log +5 -0
- package/docs/reports/unified-9.0.28/raw/frontend.log +151 -0
- package/docs/reports/unified-9.0.28/raw/installer.log +26 -0
- package/docs/reports/unified-9.0.28/raw/lint.log +5 -0
- package/docs/reports/unified-9.0.28/raw/modules.log +5 -0
- package/docs/reports/unified-9.0.28/raw/node22-tests-final.log +17060 -0
- package/docs/reports/unified-9.0.28/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.28/raw/node24-tests-final.log +2845 -0
- package/docs/reports/unified-9.0.28/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.28/raw/npm-audit-runtime.json +77 -0
- package/docs/reports/unified-9.0.28/raw/runtime-mirror-check.log +1 -0
- package/docs/reports/unified-9.0.28/raw/typecheck.log +5 -0
- package/docs/reports/unified-9.0.28/raw/ui-runtime.log +7 -0
- package/docs/reports/unified-9.0.4/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.5/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.6/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.7/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.8/PRUEFBERICHT.md +1 -1
- package/docs/reports/unified-9.0.9/PRUEFBERICHT.md +1 -1
- package/{START_HIER_9.0.1.md → docs/start/START_HIER_9.0.1.md} +5 -5
- package/{START_HIER_9.0.10.md → docs/start/START_HIER_9.0.10.md} +1 -1
- package/{START_HIER_9.0.11.md → docs/start/START_HIER_9.0.11.md} +1 -1
- package/{START_HIER_9.0.12.md → docs/start/START_HIER_9.0.12.md} +1 -1
- package/{START_HIER_9.0.13.md → docs/start/START_HIER_9.0.13.md} +2 -2
- package/{START_HIER_9.0.14.md → docs/start/START_HIER_9.0.14.md} +1 -1
- package/{START_HIER_9.0.15.md → docs/start/START_HIER_9.0.15.md} +2 -2
- package/{START_HIER_9.0.16.md → docs/start/START_HIER_9.0.16.md} +1 -1
- package/{START_HIER_9.0.17.md → docs/start/START_HIER_9.0.17.md} +2 -2
- package/{START_HIER_9.0.18.md → docs/start/START_HIER_9.0.18.md} +4 -4
- package/{START_HIER_9.0.19.md → docs/start/START_HIER_9.0.19.md} +2 -2
- package/{START_HIER_9.0.2.md → docs/start/START_HIER_9.0.2.md} +2 -2
- package/{START_HIER_9.0.20.md → docs/start/START_HIER_9.0.20.md} +1 -1
- package/{START_HIER_9.0.21.md → docs/start/START_HIER_9.0.21.md} +1 -1
- package/{START_HIER_9.0.22.md → docs/start/START_HIER_9.0.22.md} +4 -4
- package/{START_HIER_9.0.24.md → docs/start/START_HIER_9.0.24.md} +1 -1
- package/{START_HIER_9.0.25.md → docs/start/START_HIER_9.0.25.md} +1 -1
- package/{START_HIER_9.0.26.md → docs/start/START_HIER_9.0.26.md} +1 -1
- package/{START_HIER_9.0.27.md → docs/start/START_HIER_9.0.27.md} +3 -3
- package/docs/start/START_HIER_9.0.28.md +20 -0
- package/{START_HIER_9.0.3.md → docs/start/START_HIER_9.0.3.md} +3 -3
- package/{START_HIER_9.0.4.md → docs/start/START_HIER_9.0.4.md} +3 -3
- package/{START_HIER_9.0.5.md → docs/start/START_HIER_9.0.5.md} +2 -2
- package/{START_HIER_9.0.6.md → docs/start/START_HIER_9.0.6.md} +3 -3
- package/{START_HIER_9.0.7.md → docs/start/START_HIER_9.0.7.md} +4 -4
- package/{START_HIER_9.0.8.md → docs/start/START_HIER_9.0.8.md} +3 -3
- package/{START_HIER_9.0.9.md → docs/start/START_HIER_9.0.9.md} +1 -1
- package/docs/unified/ARCHITECTURE.md +37 -1
- package/docs/unified/BESTANDSUEBERNAHME_9_0_7.md +1 -1
- package/docs/unified/INSTALL_PUBLISH.md +2 -2
- package/io-package.json +8 -8
- package/package.json +35 -30
- package/release-manifests/unified/build-environment.cdx.json +6 -6
- package/release-manifests/unified/files.json +269 -126
- package/release-manifests/unified/frontend.cdx.json +6 -6
- package/release-manifests/unified/installer.cdx.json +6 -6
- package/release-manifests/unified/obsolete-admin-assets.json +89 -6
- package/release-manifests/unified/runtime.cdx.json +26 -26
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-manifest.cjs +2 -2
- package/ui/io-package.json +5 -1
- package/ui/lib/smarthome-device-detection.js +177 -4
- package/ui/main.js +69 -5
- package/ui/package.json +1 -1
- package/ui/www/licenses/smarthome-markdown-components.json +156 -156
- package/ui/www/manifest.webmanifest +2 -2
- package/ui/www/smarthome-config-workspace.css +7 -0
- package/ui/www/smarthome-config.html +4 -4
- package/ui/www/smarthome-config.js +178 -163
- package/ui/www/smarthome-device-config.js +131 -6
- package/ui/www/smarthome-setup.js +252 -59
- package/adminWww/assets/AccessTime-CuR73YC3.js +0 -1
- package/adminWww/assets/ConfigManager-D33l1qlC.js +0 -1
- package/adminWww/assets/Enums-HlPEZ4AF.js +0 -92
- package/adminWww/assets/Fields-BWBgNDOp.js +0 -1
- package/adminWww/assets/Files-BYaJp3AG.js +0 -1
- package/adminWww/assets/Instances-C5kAjcqw.js +0 -4
- package/adminWww/assets/Intro-B8keS0Ph.js +0 -2
- package/adminWww/assets/KeyboardArrowRight-ifvmV1ZL.js +0 -1
- package/adminWww/assets/MoreHoriz-CS7nODK8.js +0 -1
- package/adminWww/assets/Overview-BmjcCFve.js +0 -3
- package/adminWww/assets/Pageview-wzrLQZ-j.js +0 -1
- package/adminWww/assets/PersonOff-YtHcY0sV.js +0 -1
- package/adminWww/assets/Star-D8VNXawT.js +0 -1
- package/adminWww/assets/State-DQz1O54D.js +0 -1
- package/adminWww/assets/UsedResources-DOAuH0-U.js +0 -2
- package/adminWww/assets/Users-Dv1iXiRk.js +0 -1
- package/adminWww/assets/ViewCompact-D7bHgn99.js +0 -1
- package/adminWww/assets/ViewSidebar-CjClbCI5.js +0 -1
- package/adminWww/assets/WifiTethering-DJ9VO12W.js +0 -1
- package/adminWww/assets/date-fns-BtR4dG_j.js +0 -1
- package/adminWww/assets/en-US-BjjaEI6N.js +0 -1
- package/adminWww/assets/icons-material-Apny8Mbp.js +0 -1
- package/adminWww/assets/isSameWeek-WMSJR5Qs.js +0 -1
- package/adminWww/assets/locale-DN6Bdkdt.js +0 -1
- package/adminWww/assets/sentry-CPzCHrwe.js +0 -1
- package/adminWww/assets/setYear-DDSuW45e.js +0 -1
- package/adminWww/remoteEntry-eos-9.0.27.js +0 -12
- /package/{START_HIER_9.0.23.md → docs/start/START_HIER_9.0.23.md} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/lib/smarthome-device-detection.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:92d53f29ccafb2605558d752bc440d388a19175907159a9d45c72c5557d9a6f4
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -25,6 +25,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.DetectionScan = exports.DetectionError = exports.DETECTION_LIMITS = void 0;
|
|
26
26
|
exports.detectionNow = detectionNow;
|
|
27
27
|
exports.detectionSnapshot = detectionSnapshot;
|
|
28
|
+
exports.collectKeywordDetectionCandidates = collectKeywordDetectionCandidates;
|
|
29
|
+
exports.keywordReviewSuggestion = keywordReviewSuggestion;
|
|
28
30
|
exports.cleanControls = cleanControls;
|
|
29
31
|
exports.getControlIdentity = getControlIdentity;
|
|
30
32
|
exports.extendSuggestion = extendSuggestion;
|
|
@@ -127,6 +129,29 @@ const LEGACY_TYPES = new Set(['switch', 'dimmer', 'color', 'blind', 'rtr', 'scen
|
|
|
127
129
|
const SAFE_KEY = /^[A-Z][A-Z0-9_]{0,63}$/;
|
|
128
130
|
const DIAGNOSTIC_KEYS = new Set(['BATTERY', 'RSSI', 'LOWBAT', 'UNREACH', 'UNREACH_STICKY', 'MAINTAIN', 'ERROR', 'CONNECTED', 'WORKING', 'DIRECTION', 'DIRECTION_ENUM']);
|
|
129
131
|
const PROFILE_FIELDS = new Map((0, smarthome_device_controls_1.getControlProfiles)().map(profile => [profile.id, profile.fields.map(row)]));
|
|
132
|
+
const FUNCTION_PROFILES = Object.freeze({
|
|
133
|
+
switch: 'switch', socket: 'switch', light: 'switch', switchPower: 'switch',
|
|
134
|
+
dimmer: 'dimmer', rgb: 'dimmer', rgbSingle: 'dimmer', rgbwSingle: 'dimmer', hue: 'dimmer', cie: 'dimmer', ct: 'dimmer',
|
|
135
|
+
blind: 'blind', blinds: 'blind', blindButtons: 'blind', gate: 'blind',
|
|
136
|
+
temperature: 'climate', humidity: 'climate', thermostat: 'climate', airCondition: 'climate', airQuality: 'climate',
|
|
137
|
+
info: 'status', contact: 'status', door: 'status', window: 'status', windowTilt: 'status', motion: 'status',
|
|
138
|
+
illuminance: 'status', pressure: 'status', flow: 'status', fillLevel: 'status', electricity: 'status',
|
|
139
|
+
buttonSensor: 'status', fireAlarm: 'status', coAlarm: 'status', floodAlarm: 'status', warning: 'status',
|
|
140
|
+
});
|
|
141
|
+
// Use complete tokens and known compounds. Generic words such as LEVEL, SET,
|
|
142
|
+
// Position, Status or Power on their own cannot prove a device family.
|
|
143
|
+
const SWITCH_WORDS = /\b(?:schalt(?:en|er|befehl|status|zustand|r(?:u|ue)ckmeldung)?|switch(?:ing)?|toggle|on off|ein aus)\b/u;
|
|
144
|
+
const DIMMER_WORDS = /\b(?:dim|dimm(?:er|en|ing|wert|status|r(?:u|ue)ckmeldung)?|brightness|helligkeit(?:swert|sr(?:u|ue)ckmeldung|sstatus)?)\b/u;
|
|
145
|
+
const BLIND_WORDS = /\b(?:jalousie(?:n|position|status|steuerung)?|rolll?ad(?:en|enposition|enstatus)|rolllaeden|raffstoren?|rollo(?:s|position|status)?|shutters?|roller blinds?|blinds?|awnings?|markisen?|behang(?:hohe|position)|lamellen?|slats?)\b/u;
|
|
146
|
+
const CLIMATE_WORDS = /\b(?:temperatur(?:en|wert)?|temperature[s]?|(?:ist|soll|raum|aussen|innen)temperatur|thermometer|thermostat|luftfeuchte|luftfeuchtigkeit|humidity)\b/u;
|
|
147
|
+
const HUMIDITY_WORDS = /\b(?:luftfeuchte|luftfeuchtigkeit|humidity)\b/u;
|
|
148
|
+
const CONTACT_WORDS = /\b(?:fensterkontakt|turkontakt|tuerkontakt|window contact|door contact|reed contact)\b/u;
|
|
149
|
+
const STATUS_WORDS = /\b(?:status|zustand|r(?:u|ue)ckmeldung|feedback|actual|ist|istwert|istposition|isttemperatur|position status|schaltstatus|schaltzustand|dimmstatus|(?:schalt|dimm|helligkeits)r(?:u|ue)ckmeldung|jalousiestatus|rollladenstatus|battery|batterie|erreichbarkeit|unreachable)\b/u;
|
|
150
|
+
const COMMAND_WORDS = /\b(?:set|setpoint|soll|sollwert|solltemperatur|sollposition|target|command|befehl|fahrbefehl|schaltbefehl|write|stopp?|open|close|auf|ab)\b/u;
|
|
151
|
+
const POSITION_WORDS = /\b(?:position|istposition|positioning|stellung|level|behanghohe|behangposition|jalousieposition|rollladenposition|rolloposition)\b/u;
|
|
152
|
+
const GENERIC_ROLES = new Set(['', 'state', 'level', 'value']);
|
|
153
|
+
const STANDARD_PERCENT = '%';
|
|
154
|
+
const TEMPERATURE_UNITS = new Set(['°c', '°f', 'k', '℃', '℉']);
|
|
130
155
|
function row(value) { return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : {}; }
|
|
131
156
|
function text(value) { return typeof value === 'string' ? value.trim() : ''; }
|
|
132
157
|
function list(value) { return Array.isArray(value) ? value : []; }
|
|
@@ -146,6 +171,146 @@ function fieldDefinition(fields, key) {
|
|
|
146
171
|
return fields.find(item => item.key === key || (typeof item.key === 'string' && item.key.includes('%d')
|
|
147
172
|
&& new RegExp('^' + item.key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace('%d', '[0-9]{1,3}') + '$').test(key)));
|
|
148
173
|
}
|
|
174
|
+
/** Localized ioBroker names can be objects. Keep both languages so the same
|
|
175
|
+
* channel is detectable regardless of the browser or controller language. */
|
|
176
|
+
function keywordText(value) {
|
|
177
|
+
return value.slice(0, 512).normalize('NFKD').replace(/\p{M}/gu, '').replace(/ß/gu, 'ss')
|
|
178
|
+
.replace(/([a-z\d])([A-Z])/gu, '$1 $2').toLowerCase().replace(/[^a-z0-9]+/gu, ' ').trim();
|
|
179
|
+
}
|
|
180
|
+
function keywordName(value) {
|
|
181
|
+
const localized = row(value);
|
|
182
|
+
return [text(value), text(localized.de), text(localized.en)].map(keywordText).filter(Boolean).join(' ');
|
|
183
|
+
}
|
|
184
|
+
function keywordLabel(name, id) {
|
|
185
|
+
const localized = row(name);
|
|
186
|
+
return (text(name) || text(localized.de) || text(localized.en) || id).slice(0, 160);
|
|
187
|
+
}
|
|
188
|
+
/** Names and direct channel context narrow generic metadata. They never grant
|
|
189
|
+
* a command mapping or join separately addressed states into one device. */
|
|
190
|
+
function keywordMatch(common, id, objects) {
|
|
191
|
+
const role = text(common.role).toLowerCase();
|
|
192
|
+
if (!GENERIC_ROLES.has(role) || (common.read !== true && common.write !== true))
|
|
193
|
+
return undefined;
|
|
194
|
+
const label = `${keywordName(common.name)} ${keywordText(id.slice(id.lastIndexOf('.') + 1))}`;
|
|
195
|
+
const home = row(objects[parent(id)]);
|
|
196
|
+
const context = home.type === 'channel' || home.type === 'device' ? keywordName(row(home.common).name) : '';
|
|
197
|
+
const status = STATUS_WORDS.test(label);
|
|
198
|
+
const command = COMMAND_WORDS.test(label);
|
|
199
|
+
const bool = common.type === 'boolean';
|
|
200
|
+
const unit = text(common.unit).toLowerCase();
|
|
201
|
+
const percent = common.type === 'number' && unit === STANDARD_PERCENT;
|
|
202
|
+
const temperature = common.type === 'number' && TEMPERATURE_UNITS.has(unit);
|
|
203
|
+
const families = [];
|
|
204
|
+
if (bool && SWITCH_WORDS.test(label))
|
|
205
|
+
families.push('switch');
|
|
206
|
+
if (percent && DIMMER_WORDS.test(label))
|
|
207
|
+
families.push('dimmer');
|
|
208
|
+
const knownBlind = BLIND_WORDS.test(`${label} ${context}`);
|
|
209
|
+
const blindPosition = percent && knownBlind && (BLIND_WORDS.test(label) || POSITION_WORDS.test(label));
|
|
210
|
+
if (blindPosition || (bool && knownBlind && (command || status)))
|
|
211
|
+
families.push('blind');
|
|
212
|
+
const humidity = percent && HUMIDITY_WORDS.test(label);
|
|
213
|
+
if (humidity || (temperature && CLIMATE_WORDS.test(label)))
|
|
214
|
+
families.push('climate');
|
|
215
|
+
const contact = bool && CONTACT_WORDS.test(label);
|
|
216
|
+
if (contact || (status && (bool || families.length > 0)))
|
|
217
|
+
families.push('status');
|
|
218
|
+
if (!families.length)
|
|
219
|
+
return undefined;
|
|
220
|
+
// An exact unit and explicit read-only direction make direct measurements
|
|
221
|
+
// useful independently from any actuator. Setpoints, guessed positions and
|
|
222
|
+
// unknown write flags remain candidates for manual review.
|
|
223
|
+
const competing = families.filter(family => family !== 'status').length > 1;
|
|
224
|
+
if (competing || command || common.write !== false || common.read !== true)
|
|
225
|
+
return { families, review: true };
|
|
226
|
+
if (families.includes('climate'))
|
|
227
|
+
return { families, review: false, readProfile: humidity ? 'humidity' : 'temperature' };
|
|
228
|
+
if (families.includes('dimmer') && status && common.min === 0 && common.max === 100) {
|
|
229
|
+
return { families, review: false, readProfile: 'dimmer' };
|
|
230
|
+
}
|
|
231
|
+
if (families.length === 1 && families[0] === 'status' && !contact)
|
|
232
|
+
return { families, review: false, readProfile: 'info' };
|
|
233
|
+
return { families, review: true };
|
|
234
|
+
}
|
|
235
|
+
/** Bound extra work by the original validated snapshot. Direct channel leaves
|
|
236
|
+
* and flat state roots are inspected individually after structured detection. */
|
|
237
|
+
async function* collectKeywordDetectionCandidates(objects, keys, allowedRoots, coveredStateIds, scan) {
|
|
238
|
+
scan.check();
|
|
239
|
+
let inspected = 0;
|
|
240
|
+
for (const stateId of keys) {
|
|
241
|
+
if (++inspected % 250 === 0) {
|
|
242
|
+
await new Promise(resolve => setImmediate(resolve));
|
|
243
|
+
scan.check();
|
|
244
|
+
}
|
|
245
|
+
if (coveredStateIds.has(stateId) || /^(?:alias|system|admin)\./iu.test(stateId)
|
|
246
|
+
|| (!allowedRoots.has(stateId) && !allowedRoots.has(parent(stateId))))
|
|
247
|
+
continue;
|
|
248
|
+
const common = stateObject(objects, stateId);
|
|
249
|
+
if (!common || common.alias || common.password === true || common.encrypted === true)
|
|
250
|
+
continue;
|
|
251
|
+
const match = keywordMatch(common, stateId, objects);
|
|
252
|
+
if (!match)
|
|
253
|
+
continue;
|
|
254
|
+
const profile = match.readProfile ?? 'info';
|
|
255
|
+
// The existing profile validator also checks forbidden ID paths. For a
|
|
256
|
+
// review item this is validation only; there is no stored binding.
|
|
257
|
+
try {
|
|
258
|
+
(0, smarthome_device_controls_1.normalizeDeviceControls)({ profile, fields: [{ key: 'ACTUAL', readId: stateId }] });
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
scan.check();
|
|
264
|
+
const label = keywordLabel(common.name, stateId);
|
|
265
|
+
const state = { id: stateId, label, key: 'ACTUAL', type: text(common.type), role: text(common.role).slice(0, 96),
|
|
266
|
+
unit: text(common.unit).slice(0, 32), read: common.read === true, write: common.write === true };
|
|
267
|
+
yield { sourceId: stateId, stateId, label, state, functionCategories: match.families,
|
|
268
|
+
...(match.readProfile ? { control: { type: match.readProfile, states: [{ name: 'ACTUAL', id: stateId, required: true }] } } : {}) };
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function keywordReviewSuggestion(candidate) {
|
|
272
|
+
return { id: `td_review_${digest(candidate.stateId).slice(0, 24)}`, sourceId: candidate.sourceId, sourceType: 'state',
|
|
273
|
+
displayName: candidate.label, sourceName: candidate.label, importable: false, discoveryReview: true,
|
|
274
|
+
functionCategories: [...new Set([...candidate.functionCategories, 'review'])], matchCount: 0,
|
|
275
|
+
states: [candidate.state], notes: ['Datenpunkt anhand von Name und Eigenschaften gefunden. Funktion und Rückmeldung bitte manuell zuordnen.'] };
|
|
276
|
+
}
|
|
277
|
+
function suggestionCategories(profile, states, objects, importable) {
|
|
278
|
+
const family = Object.hasOwn(FUNCTION_PROFILES, profile) ? FUNCTION_PROFILES[profile] : undefined;
|
|
279
|
+
const categories = new Set([family ?? 'other']);
|
|
280
|
+
let discoveryReview = !importable;
|
|
281
|
+
let conflictingControl = false;
|
|
282
|
+
for (const state of states) {
|
|
283
|
+
const key = text(state.key);
|
|
284
|
+
if (state.type === 'boolean' && ['ON', 'ON_SET', 'ON_ACTUAL', 'POWER'].includes(key))
|
|
285
|
+
categories.add('switch');
|
|
286
|
+
if (state.read === true && (state.indicator === true || DIAGNOSTIC_KEYS.has(key)
|
|
287
|
+
|| key === 'ON_ACTUAL' || (key === 'ACTUAL' && (family === 'switch' || family === 'blind' || family === 'dimmer'))))
|
|
288
|
+
categories.add('status');
|
|
289
|
+
if (profile !== 'info' && family !== 'switch')
|
|
290
|
+
continue;
|
|
291
|
+
const id = text(state.id);
|
|
292
|
+
const common = stateObject(objects, id);
|
|
293
|
+
if (!common)
|
|
294
|
+
continue;
|
|
295
|
+
const match = keywordMatch(common, id, objects);
|
|
296
|
+
if (!match)
|
|
297
|
+
continue;
|
|
298
|
+
if (profile === 'info') {
|
|
299
|
+
match.families.forEach(category => categories.add(category));
|
|
300
|
+
discoveryReview || (discoveryReview = match.review);
|
|
301
|
+
}
|
|
302
|
+
else if (match.families.includes('blind')) {
|
|
303
|
+
// A generic boolean can be matched by the upstream switch profile.
|
|
304
|
+
// Surface the inconclusive category; never invent up/down actions.
|
|
305
|
+
categories.add('blind');
|
|
306
|
+
discoveryReview = true;
|
|
307
|
+
conflictingControl || (conflictingControl = state.write === true);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (discoveryReview)
|
|
311
|
+
categories.add('review');
|
|
312
|
+
return { functionCategories: [...categories], discoveryReview, conflictingControl };
|
|
313
|
+
}
|
|
149
314
|
function managedIdentity(sourceId, control, objects) {
|
|
150
315
|
if (!sourceId.startsWith('alias.0.nexowatt_eos.'))
|
|
151
316
|
return null;
|
|
@@ -227,7 +392,7 @@ function extendSuggestion(input, controlInput, objects) {
|
|
|
227
392
|
const original = row(input);
|
|
228
393
|
const control = cleanControls([controlInput], objects)[0];
|
|
229
394
|
if (!control)
|
|
230
|
-
return { ...original, importable: false };
|
|
395
|
+
return { ...original, importable: false, functionCategories: ['review'], discoveryReview: true };
|
|
231
396
|
const profileFields = definitions(control.type);
|
|
232
397
|
const mappings = new Map();
|
|
233
398
|
const states = [];
|
|
@@ -276,11 +441,19 @@ function extendSuggestion(input, controlInput, objects) {
|
|
|
276
441
|
catch {
|
|
277
442
|
controlsValid = false;
|
|
278
443
|
}
|
|
444
|
+
const importable = fields.length > 0 && hasCore && controlsValid;
|
|
445
|
+
const { functionCategories, discoveryReview, conflictingControl } = suggestionCategories(control.type, states, objects, importable);
|
|
446
|
+
const notes = list(original.notes).slice();
|
|
447
|
+
if (!controlsValid)
|
|
448
|
+
notes.push('Die erkannte Bedienzuordnung enthält nicht zulässige Datenpunkte oder zu viele Felder. Bitte manuell prüfen.');
|
|
449
|
+
else if (conflictingControl)
|
|
450
|
+
notes.push('Die Beschreibung deutet auf Beschattung hin. Ein allgemeiner Schaltbefehl wird dafür nicht automatisch übernommen.');
|
|
451
|
+
else if (discoveryReview && importable)
|
|
452
|
+
notes.push('Die Beschreibung lässt mehrere Funktionen zu. Prüfe den Datenpunkt vor der Übernahme.');
|
|
279
453
|
const proposal = { ...previous, type, io: { ...row(previous.io), deviceControls: { profile: control.type, fields } },
|
|
280
454
|
behavior: { ...row(previous.behavior), readOnly: !writable } };
|
|
281
455
|
return { ...original, id: `td_${controlId.slice(0, 24)}`, controlId,
|
|
282
456
|
...(managed ? { sourceId: managed.sourceId, displaySourceId, managedAlias: true } : {}), detectorType: control.type, targetType: type,
|
|
283
457
|
signature: `${control.type}|${fields.map(field => `${field.key}:${field.readId || ''}:${field.writeId || ''}`).join('|')}`,
|
|
284
|
-
states, matchCount: fields.length, proposal, importable:
|
|
285
|
-
notes: [...list(original.notes), ...(!controlsValid ? ['Die erkannte Bedienzuordnung enthält nicht zulässige Datenpunkte oder zu viele Felder. Bitte manuell prüfen.'] : [])] };
|
|
458
|
+
states, matchCount: fields.length, proposal, importable: importable && !discoveryReview, functionCategories, discoveryReview, notes };
|
|
286
459
|
}
|
package/ui/main.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/main.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:2e8e4d4b14ec885e68c7127c75bee1f355db2521addbf8e46c94a91bfd462f27
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -42,7 +42,7 @@ const { executeLegacyDeviceWrite } = require('./lib/smarthome-device-legacy');
|
|
|
42
42
|
const { normalizeCustomView } = require('./lib/smarthome-custom-contract');
|
|
43
43
|
const { normalizeDeviceControls, getControlProfiles } = require('./lib/smarthome-device-controls');
|
|
44
44
|
const { registerSmartHomeDeviceApi, createDeviceSnapshotReader, buildDeviceControls } = require('./lib/smarthome-device-api');
|
|
45
|
-
const { cleanControls, extendSuggestion, DetectionError, DetectionScan, DETECTION_LIMITS, detectionNow, detectionSnapshot } = require('./lib/smarthome-device-detection');
|
|
45
|
+
const { cleanControls, extendSuggestion, collectKeywordDetectionCandidates, keywordReviewSuggestion, DetectionError, DetectionScan, DETECTION_LIMITS, detectionNow, detectionSnapshot } = require('./lib/smarthome-device-detection');
|
|
46
46
|
const { smartHomeEnabled, registerSmartHomeActivationApi } = require('./lib/smarthome-activation');
|
|
47
47
|
const { readPreservedUiStates, parseInstallerConfigState } = require('./lib/preserved-ui-config');
|
|
48
48
|
const { createRuntimeFileSender, runtimeProxyPrefix, rewriteRuntimeProxyHtml, isHttpsRuntimeProxy } = require('./lib/runtime-proxy-html');
|
|
@@ -14777,7 +14777,7 @@ const nwShcfgTdMergeSuggestion = (current, next) => {
|
|
|
14777
14777
|
* Zusammenhang: Teil von Adapterkern: Lifecycle, Webserver, API, States, EMS-Engine; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
|
|
14778
14778
|
* TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
|
|
14779
14779
|
*/
|
|
14780
|
-
const nwShcfgTdBuildSuggestion = async ({ control, rootId, objects, configuredIds, config }) => {
|
|
14780
|
+
const nwShcfgTdBuildSuggestion = async ({ control, rootId, objects, configuredIds, config, keywordState = false }) => {
|
|
14781
14781
|
if (!control || !control.type) return null;
|
|
14782
14782
|
const detectorType = String(control.type || '').trim();
|
|
14783
14783
|
const targetType = NW_SHCFG_TD_TYPE_MAP[detectorType];
|
|
@@ -14794,7 +14794,7 @@ const nwShcfgTdBuildSuggestion = async ({ control, rootId, objects, configuredId
|
|
|
14794
14794
|
const states = Array.from(stateMap.values());
|
|
14795
14795
|
if (!states.length) return null;
|
|
14796
14796
|
|
|
14797
|
-
const sourceId = nwShcfgTdBestSourceId(objects, rootId, control) || String(rootId || '').trim();
|
|
14797
|
+
const sourceId = (keywordState ? rootId : nwShcfgTdBestSourceId(objects, rootId, control)) || String(rootId || '').trim();
|
|
14798
14798
|
const sourceObj = sourceId ? objects[sourceId] : null;
|
|
14799
14799
|
const sourceType = String((sourceObj && sourceObj.type) || (objects[rootId] && objects[rootId].type) || 'state').trim() || 'state';
|
|
14800
14800
|
const sourceName = nwShcfgTdNormName(sourceObj && sourceObj.common && sourceObj.common.name) || (sourceId ? sourceId.split('.').slice(-1)[0] : 'Gerät');
|
|
@@ -15062,6 +15062,7 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15062
15062
|
scan.check('roots', roots.length);
|
|
15063
15063
|
const detector = new NwChannelDetector();
|
|
15064
15064
|
const suggestionsBySignature = new Map();
|
|
15065
|
+
const coveredStateIds = new Set(configuredIds);
|
|
15065
15066
|
let matchedRoots = 0;
|
|
15066
15067
|
|
|
15067
15068
|
let scanIndex = 0;
|
|
@@ -15091,6 +15092,7 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15091
15092
|
for (const control of controls) {
|
|
15092
15093
|
const suggestion = await nwShcfgTdBuildSuggestion({ control, rootId, objects, configuredIds, config: cfg });
|
|
15093
15094
|
if (!suggestion) continue;
|
|
15095
|
+
for (const state of suggestion.states || []) coveredStateIds.add(state.id);
|
|
15094
15096
|
const signature = suggestion.controlId || suggestion.signature || suggestion.id;
|
|
15095
15097
|
const merged = nwShcfgTdMergeSuggestion(suggestionsBySignature.get(signature), suggestion);
|
|
15096
15098
|
suggestionsBySignature.set(signature, merged);
|
|
@@ -15098,7 +15100,33 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15098
15100
|
}
|
|
15099
15101
|
}
|
|
15100
15102
|
|
|
15103
|
+
// Supplement the existing detector using the same snapshot and deadline.
|
|
15104
|
+
// A keyword match cannot combine separate group addresses or create a device command.
|
|
15105
|
+
const reviewSuggestions = [];
|
|
15106
|
+
const keywordLimit = Math.min(512, DETECTION_LIMITS.suggestions - suggestionsBySignature.size);
|
|
15107
|
+
let extraCount = 0;
|
|
15108
|
+
let extraSuggestionsLimited = false;
|
|
15109
|
+
for await (const candidate of collectKeywordDetectionCandidates(objects, keys, new Set(roots), coveredStateIds, scan)) {
|
|
15110
|
+
if (extraCount >= keywordLimit) {
|
|
15111
|
+
extraSuggestionsLimited = true;
|
|
15112
|
+
break;
|
|
15113
|
+
}
|
|
15114
|
+
extraCount += 1;
|
|
15115
|
+
if (candidate.control) {
|
|
15116
|
+
const suggestion = await nwShcfgTdBuildSuggestion({
|
|
15117
|
+
control: candidate.control, rootId: candidate.sourceId, objects, configuredIds, config: cfg, keywordState: true,
|
|
15118
|
+
});
|
|
15119
|
+
if (suggestion) {
|
|
15120
|
+
const signature = suggestion.controlId || suggestion.signature || suggestion.id;
|
|
15121
|
+
if (!suggestionsBySignature.has(signature)) suggestionsBySignature.set(signature, suggestion);
|
|
15122
|
+
continue;
|
|
15123
|
+
}
|
|
15124
|
+
}
|
|
15125
|
+
reviewSuggestions.push(keywordReviewSuggestion(candidate));
|
|
15126
|
+
}
|
|
15127
|
+
|
|
15101
15128
|
const suggestions = reconcileSmartHomeImportSuggestions(Array.from(suggestionsBySignature.values()), objects, cfg)
|
|
15129
|
+
.concat(reviewSuggestions)
|
|
15102
15130
|
.map((entry) => {
|
|
15103
15131
|
if (entry && entry.signature) delete entry.signature;
|
|
15104
15132
|
return entry;
|
|
@@ -15129,6 +15157,7 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15129
15157
|
complete: true,
|
|
15130
15158
|
objectCount: keys.length,
|
|
15131
15159
|
elapsedMs: Math.round(scan.elapsedMs),
|
|
15160
|
+
...(extraSuggestionsLimited ? { extraSuggestionsLimited: true } : {}),
|
|
15132
15161
|
...(suggestions.length ? {} : { emptyReason: roots.length ? 'NO_MATCHES' : 'NO_CANDIDATES' }),
|
|
15133
15162
|
},
|
|
15134
15163
|
suggestions,
|
|
@@ -15433,6 +15462,19 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15433
15462
|
const qRaw = (req.query && req.query.q) || '';
|
|
15434
15463
|
const q = (typeof qRaw === 'string' ? qRaw : String(qRaw || '')).trim();
|
|
15435
15464
|
const qLower = (q || '').toLowerCase();
|
|
15465
|
+
const direction = req.query?.direction;
|
|
15466
|
+
const allowedTypes = new Set(['boolean', 'number', 'string']);
|
|
15467
|
+
function csvFilter(value, maxItems, validator) {
|
|
15468
|
+
if (value === undefined) return new Set();
|
|
15469
|
+
if (typeof value !== 'string' || !value || value.length > 1024) return null;
|
|
15470
|
+
const entries = value.split(',');
|
|
15471
|
+
return entries.length <= maxItems && entries.every(validator) ? new Set(entries) : null;
|
|
15472
|
+
}
|
|
15473
|
+
const types = csvFilter(req.query?.types, 3, value => allowedTypes.has(value));
|
|
15474
|
+
const roles = csvFilter(req.query?.roles, 16, value => /^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/.test(value));
|
|
15475
|
+
if ((direction !== undefined && direction !== 'read' && direction !== 'write') || !types || !roles) {
|
|
15476
|
+
return res.status(400).json({ ok: false, error: 'EOS_DP_FILTER_INVALID' });
|
|
15477
|
+
}
|
|
15436
15478
|
|
|
15437
15479
|
const limitRaw = (req.query && req.query.limit) || '';
|
|
15438
15480
|
let limit = parseInt(limitRaw, 10);
|
|
@@ -15477,6 +15519,8 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15477
15519
|
type: obj.common.type || '',
|
|
15478
15520
|
|
|
15479
15521
|
unit: obj.common.unit || '',
|
|
15522
|
+
read: obj.common.read === true,
|
|
15523
|
+
write: obj.common.write === true,
|
|
15480
15524
|
|
|
15481
15525
|
idLower: String(id).toLowerCase(),
|
|
15482
15526
|
|
|
@@ -15551,6 +15595,8 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15551
15595
|
*/
|
|
15552
15596
|
function pushItem(it) {
|
|
15553
15597
|
if (!it || !it.id || seen.has(it.id)) return;
|
|
15598
|
+
if (direction && it[direction] !== true) return;
|
|
15599
|
+
if (types.size && !types.has(it.type)) return;
|
|
15554
15600
|
seen.add(it.id);
|
|
15555
15601
|
results.push({
|
|
15556
15602
|
id: it.id,
|
|
@@ -15558,9 +15604,24 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15558
15604
|
role: it.role,
|
|
15559
15605
|
type: it.type,
|
|
15560
15606
|
unit: it.unit,
|
|
15607
|
+
read: it.read,
|
|
15608
|
+
write: it.write,
|
|
15561
15609
|
});
|
|
15562
15610
|
}
|
|
15563
15611
|
|
|
15612
|
+
function matchesQuery(it) {
|
|
15613
|
+
return !qLower || it.idLower.includes(qLower) || it.nameLower.includes(qLower)
|
|
15614
|
+
|| (direction && typeof it.role === 'string' && it.role.toLowerCase().includes(qLower));
|
|
15615
|
+
}
|
|
15616
|
+
// Reserve the first results for the requested function even with
|
|
15617
|
+
// thousands of other devices in earlier branches of the object tree.
|
|
15618
|
+
if (roles.size) {
|
|
15619
|
+
for (const it of items) {
|
|
15620
|
+
if (roles.has(it.role) && matchesQuery(it)) pushItem(it);
|
|
15621
|
+
if (results.length >= limit) return res.json({ ok: true, results });
|
|
15622
|
+
}
|
|
15623
|
+
}
|
|
15624
|
+
|
|
15564
15625
|
if (!qLower) {
|
|
15565
15626
|
// Browse-Mode: zeige zuerst typische Admin-Bereiche
|
|
15566
15627
|
const preferredPrefixes = ['0_userdata.0.', 'alias.0.', 'javascript.0.'];
|
|
@@ -15584,7 +15645,7 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
15584
15645
|
}
|
|
15585
15646
|
|
|
15586
15647
|
for (const it of items) {
|
|
15587
|
-
if (
|
|
15648
|
+
if (matchesQuery(it)) {
|
|
15588
15649
|
pushItem(it);
|
|
15589
15650
|
if (results.length >= limit) break;
|
|
15590
15651
|
}
|
|
@@ -18505,6 +18566,8 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
18505
18566
|
role: obj.common.role || '',
|
|
18506
18567
|
type: obj.common.type || '',
|
|
18507
18568
|
unit: obj.common.unit || '',
|
|
18569
|
+
read: obj.common.read === true,
|
|
18570
|
+
write: obj.common.write === true,
|
|
18508
18571
|
idLower: String(id).toLowerCase(),
|
|
18509
18572
|
nameLower: String(name).toLowerCase(),
|
|
18510
18573
|
});
|
|
@@ -18564,6 +18627,7 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
|
|
|
18564
18627
|
role: it ? it.role : '',
|
|
18565
18628
|
type: it ? it.type : '',
|
|
18566
18629
|
unit: it ? it.unit : '',
|
|
18630
|
+
...(it ? { read: it.read, write: it.write } : {}),
|
|
18567
18631
|
});
|
|
18568
18632
|
}
|
|
18569
18633
|
|
package/ui/package.json
CHANGED