iobroker.eos-admin 9.0.27 → 9.0.29
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 +10 -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-DXp4Dgkx.js} +5 -5
- package/adminWww/assets/{Adapters-Db3kbmAj.js → Adapters-1AOp__74.js} +5 -5
- package/adminWww/assets/AddLink-0L0E-LsA.js +1 -0
- package/adminWww/assets/ColorLens-DA51K29x.js +1 -0
- package/adminWww/assets/ConfigManager-CGGXU4Jp.js +1 -0
- package/adminWww/assets/Enums-Bl4EngJF.js +92 -0
- package/adminWww/assets/Fields-zSEjRWOB.js +1 -0
- package/adminWww/assets/FileCopy-B16lEuur.js +1 -0
- package/adminWww/assets/Files-CnYmjEbu.js +1 -0
- package/adminWww/assets/{Hosts-DimiJ78g.js → Hosts-zFJyiuvd.js} +6 -6
- package/adminWww/assets/Instances-D10dnQY4.js +4 -0
- package/adminWww/assets/Intro-DxLBfGZ8.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-CAc6o-d_.js} +2 -2
- package/adminWww/assets/North-C2whbHM-.js +1 -0
- package/adminWww/assets/{Objects-oliB7_Se.js → Objects-I64lF3ZS.js} +4 -4
- package/adminWww/assets/Overview-BQ7HBH-7.js +3 -0
- package/adminWww/assets/PersonOff-DqBq0Fho.js +1 -0
- package/adminWww/assets/PlaylistAdd-O8k92YBd.js +1 -0
- package/adminWww/assets/State-DHLL8gAc.js +1 -0
- package/adminWww/assets/UsedResources-DlQ_XqoR.js +2 -0
- package/adminWww/assets/Users-CKHDvxG5.js +1 -0
- package/adminWww/assets/{bootstrap-BVw0diuj.js → bootstrap-CIDT4MeX.js} +25 -25
- package/adminWww/assets/date-fns-C1dqkno9.js +1 -0
- package/adminWww/assets/{hostInit-C_7OBoza.js → hostInit-Cvl4lPGh.js} +1 -1
- package/adminWww/assets/icons-material-ngdwOXrt.js +1 -0
- package/adminWww/assets/{index-DwDSxDMx.js → index-B9Tfj1YG.js} +2 -2
- package/adminWww/assets/{installSVGRenderer--VTzKbml.js → installSVGRenderer-COP6GC9p.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-31191d2e.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.29.js +12 -0
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosTlsHttp.js +25 -0
- package/build/lib/eosTlsHttp.js.map +1 -1
- package/build/lib/eosTlsManager.js +317 -67
- package/build/lib/eosTlsManager.js.map +1 -1
- package/docs/DOKUMENTATION_9.0.27.md +7 -0
- package/docs/README.md +14 -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.29/PRUEFBERICHT.md +30 -0
- package/docs/reports/unified-9.0.29/PRUEFERGEBNISSE.json +112 -0
- package/docs/reports/unified-9.0.29/raw/INDEX.json +97 -0
- package/docs/reports/unified-9.0.29/raw/backend.log +5 -0
- package/docs/reports/unified-9.0.29/raw/frontend.log +151 -0
- package/docs/reports/unified-9.0.29/raw/installer.log +26 -0
- package/docs/reports/unified-9.0.29/raw/lint.log +5 -0
- package/docs/reports/unified-9.0.29/raw/modules.log +5 -0
- package/docs/reports/unified-9.0.29/raw/node22-tests-final.log +17104 -0
- package/docs/reports/unified-9.0.29/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.29/raw/node24-tests-final.log +2852 -0
- package/docs/reports/unified-9.0.29/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.29/raw/npm-audit-runtime.json +77 -0
- package/docs/reports/unified-9.0.29/raw/tls-lint.log +0 -0
- package/docs/reports/unified-9.0.29/raw/tls-targeted-build-node22.log +139 -0
- package/docs/reports/unified-9.0.29/raw/tls-targeted-node24.log +132 -0
- package/docs/reports/unified-9.0.29/raw/typecheck.log +5 -0
- package/docs/reports/unified-9.0.29/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/docs/start/START_HIER_9.0.29.md +22 -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/docs/unified/NEXOWATT_TLS_DE.md +18 -4
- package/io-package.json +12 -12
- package/package.json +38 -31
- package/public/eos-tls/index.html +96 -8
- package/public/eos-tls/index.js +194 -41
- package/release-manifests/unified/build-environment.cdx.json +6 -6
- package/release-manifests/unified/files.json +300 -136
- 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 +214 -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 +9 -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
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