iobroker.eos-admin 9.0.26 → 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 -15
- package/README.md +17 -227
- package/adminWww/.vite/manifest.json +194 -203
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13887 -13897
- package/adminWww/assets/{AdapterUpdateDialog-DIjnNZ5k.js → AdapterUpdateDialog-DBLX7GoO.js} +5 -5
- package/adminWww/assets/{Adapters-D8UOQg1q.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-BToJLy61.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-xdFVJ6fZ.js → Logs-Brgb9kR_.js} +2 -2
- package/adminWww/assets/North-C2whbHM-.js +1 -0
- package/adminWww/assets/{Objects-DhyJ5eAY.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-BU7j1Fe_.js → bootstrap-st8VxLDc.js} +25 -25
- package/adminWww/assets/date-fns-C1dqkno9.js +1 -0
- package/adminWww/assets/{hostInit-Cgee6juw.js → hostInit-OQMl4yOT.js} +1 -1
- package/adminWww/assets/icons-material-DeF0gQyK.js +1 -0
- package/adminWww/assets/{index-BUZf1ftI.js → index-D4lV2S7J.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-CcjgaxiA.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-96d40e57.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/build/lib/eosDeviceEmsPlan.js +24 -1
- package/build/lib/eosDeviceEmsPlan.js.map +1 -1
- package/build/lib/eosModuleHost.js +66 -3
- package/build/lib/eosModuleHost.js.map +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.27/ABHAENGIGKEITEN.md +27 -0
- package/docs/reports/unified-9.0.27/PRUEFBERICHT.md +68 -0
- package/docs/reports/unified-9.0.27/PRUEFERGEBNISSE.json +292 -0
- package/docs/reports/unified-9.0.27/SICHERHEITSBETRACHTUNG.md +26 -0
- package/docs/reports/unified-9.0.27/TIBBER_NEUSTART.md +23 -0
- package/docs/reports/unified-9.0.27/UPDATE_WIEDERANLAUF.md +46 -0
- package/docs/reports/unified-9.0.27/raw/INDEX.json +347 -0
- package/docs/reports/unified-9.0.27/raw/admin-build-mirror-review.json +75 -0
- package/docs/reports/unified-9.0.27/raw/ajv-production-reachability.json +35 -0
- package/docs/reports/unified-9.0.27/raw/backend-build.log +5 -0
- package/docs/reports/unified-9.0.27/raw/baseline-devices.log +138 -0
- package/docs/reports/unified-9.0.27/raw/baseline-module-startup.log +82 -0
- package/docs/reports/unified-9.0.27/raw/baseline-ocpp-contract.log +93 -0
- package/docs/reports/unified-9.0.27/raw/baseline-ocpp-frontend.log +255 -0
- package/docs/reports/unified-9.0.27/raw/baseline-repository-tools.log +84 -0
- package/docs/reports/unified-9.0.27/raw/browser-blocked.log +38 -0
- package/docs/reports/unified-9.0.27/raw/controller-725-reproduction-node24.log +4 -0
- package/docs/reports/unified-9.0.27/raw/devices-child-rpc-diagnostic.log +34 -0
- package/docs/reports/unified-9.0.27/raw/devices-filter-without-readiness.log +15 -0
- package/docs/reports/unified-9.0.27/raw/devices-final-web-filtered-node22.log +107 -0
- package/docs/reports/unified-9.0.27/raw/devices-final-web-filtered-node24.log +26 -0
- package/docs/reports/unified-9.0.27/raw/eos-update-path-node24.log +52 -0
- package/docs/reports/unified-9.0.27/raw/frontend-build.log +152 -0
- package/docs/reports/unified-9.0.27/raw/influx/provenance.json +42 -0
- package/docs/reports/unified-9.0.27/raw/installer-build.log +26 -0
- package/docs/reports/unified-9.0.27/raw/lint.log +5 -0
- package/docs/reports/unified-9.0.27/raw/modules-build.log +5 -0
- package/docs/reports/unified-9.0.27/raw/node22-tests-final.log +16976 -0
- package/docs/reports/unified-9.0.27/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.27/raw/node24-tests-final.log +2831 -0
- package/docs/reports/unified-9.0.27/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.27/raw/npm-audit-development.json +398 -0
- package/docs/reports/unified-9.0.27/raw/npm-audit-production.json +77 -0
- package/docs/reports/unified-9.0.27/raw/npm-production-ajv-tree.json +33 -0
- package/docs/reports/unified-9.0.27/raw/npm-production-ajv-tree.stderr +1 -0
- package/docs/reports/unified-9.0.27/raw/npm926-dateivergleich.json +6 -0
- package/docs/reports/unified-9.0.27/raw/production-audit-review.json +30 -0
- package/docs/reports/unified-9.0.27/raw/release-targeted.log +118 -0
- package/docs/reports/unified-9.0.27/raw/restart-regressions-node22.log +361 -0
- package/docs/reports/unified-9.0.27/raw/sbom-generation.json +11 -0
- package/docs/reports/unified-9.0.27/raw/source-fixtures.json +30 -0
- package/docs/reports/unified-9.0.27/raw/targeted-ocpp-frontend.log +26 -0
- package/docs/reports/unified-9.0.27/raw/test-environment.json +24 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/REVIEW.md +40 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/appcenter-overwrite-patched-scratch.log +11 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/appcenter-overwrite-repro.log +33 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/customer-tariff-lint.log +0 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/customer-tariff-typecheck.log +0 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/process-disk-restart-node24.log +10 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/roundtrip-built-diagnostic.log +58 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/roundtrip-built-ipc-counts.log +45 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/roundtrip-built-node24.log +42 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/roundtrip-final-node22.log +134 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/roundtrip-final-node24.log +28 -0
- package/docs/reports/unified-9.0.27/raw/tibber/backend/roundtrip-source-node22-diagnostic.log +220 -0
- package/docs/reports/unified-9.0.27/raw/tibber/independent/tariff-background-hydration-review.log +1 -0
- package/docs/reports/unified-9.0.27/raw/tibber/independent/tibber-header-object-mask-review.log +1 -0
- package/docs/reports/unified-9.0.27/raw/tibber/independent/tibber-independent-frontend-review.log +14 -0
- package/docs/reports/unified-9.0.27/raw/tibber/independent/tibber-independent-scope-review.log +1 -0
- package/docs/reports/unified-9.0.27/raw/tibber/independent/tibber-mapping-targeted-node24.log +2184 -0
- package/docs/reports/unified-9.0.27/raw/tibber/independent/tibber-parent-persistence-review.log +20 -0
- package/docs/reports/unified-9.0.27/raw/tibber/tariff-review/appcenter-tariff-roundtrip-baseline.log +57 -0
- package/docs/reports/unified-9.0.27/raw/tibber/tariff-review/customer-editor-final.log +24 -0
- package/docs/reports/unified-9.0.27/raw/tibber/tariff-review/frontend-guard-baseline.log +303 -0
- package/docs/reports/unified-9.0.27/raw/tibber/tariff-review/frontend-guard-final.log +14 -0
- package/docs/reports/unified-9.0.27/raw/tibber-appcenter-baseline.log +33 -0
- package/docs/reports/unified-9.0.27/raw/tibber-background-hydration-baseline.log +1 -0
- package/docs/reports/unified-9.0.27/raw/tibber-form-baseline.log +57 -0
- package/docs/reports/unified-9.0.27/raw/tibber-mapping-targeted-node24.log +2184 -0
- package/docs/reports/unified-9.0.27/raw/tibber-minimal-fix-isolation.log +11 -0
- package/docs/reports/unified-9.0.27/raw/typecheck.log +5 -0
- package/docs/reports/unified-9.0.27/raw/ui-build.log +7 -0
- 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/docs/start/START_HIER_9.0.27.md +33 -0
- 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 +12 -12
- package/modules/devices/admin/ems-assignment.js +1 -0
- package/package.json +38 -34
- package/release-manifests/unified/build-environment.cdx.json +6 -6
- package/release-manifests/unified/files.json +378 -146
- 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 +171 -6
- package/release-manifests/unified/runtime.cdx.json +28 -28
- 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/customer-tariff.js +73 -1
- package/ui/lib/installer-lifecycle.js +5 -3
- package/ui/lib/ocpp-auto-discovery.js +53 -6
- package/ui/lib/smarthome-device-detection.js +177 -4
- package/ui/main.js +171 -95
- package/ui/package.json +1 -1
- package/ui/www/ems-apps.js +188 -130
- 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-CAvT_4-g.js +0 -1
- package/adminWww/assets/Enums-CrNUOX0d.js +0 -92
- package/adminWww/assets/Fields-D-0qFiqr.js +0 -1
- package/adminWww/assets/Files-BL8kvaeC.js +0 -1
- package/adminWww/assets/Instances-Dlrp1KGP.js +0 -4
- package/adminWww/assets/Intro-5EbxvP4X.js +0 -2
- package/adminWww/assets/KeyboardArrowRight-ifvmV1ZL.js +0 -1
- package/adminWww/assets/MoreHoriz-CS7nODK8.js +0 -1
- package/adminWww/assets/Overview-BspgcFB7.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-CJ1mKH_U.js +0 -1
- package/adminWww/assets/UsedResources-BMiCxqWH.js +0 -2
- package/adminWww/assets/Users-DrlJHRa5.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-C0U9EKON.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.26.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/www/smarthome-device-config.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:64f3ab313554194047b2a285360ad27323d4bcb83e45cc758e2b3e9f804a8b5f
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -26,6 +26,49 @@
|
|
|
26
26
|
const host = window;
|
|
27
27
|
if (host.NW_SH_DEVICE_CONFIG)
|
|
28
28
|
return;
|
|
29
|
+
const scalarTypes = ['boolean', 'number', 'string'];
|
|
30
|
+
const genericRoles = new Set(['', 'state', 'value', 'level', 'switch', 'sensor', 'indicator', 'button']);
|
|
31
|
+
const directionTerms = {
|
|
32
|
+
read: ['ruckmeldung', 'feedback', 'status', 'lesen', 'read'],
|
|
33
|
+
write: ['befehl', 'command', 'schreiben', 'write'],
|
|
34
|
+
};
|
|
35
|
+
const temperatureUnits = new Set(['°c', '°f', 'k']);
|
|
36
|
+
const switchSignal = {
|
|
37
|
+
label: 'Schalten', read: ['sensor.switch', 'state.switch', 'sensor.light', 'state.light'],
|
|
38
|
+
write: ['switch', 'switch.light', 'switch.power', 'switch.socket'],
|
|
39
|
+
keywords: ['schalten', 'switch', 'schaltstatus', 'switch status', 'on off', 'ein aus'],
|
|
40
|
+
};
|
|
41
|
+
const dimmerSignal = {
|
|
42
|
+
label: 'Dimmen', read: ['value.dimmer', 'value.brightness'], write: ['level.dimmer', 'level.brightness'],
|
|
43
|
+
keywords: ['dimmen', 'dimmer', 'dimming', 'helligkeit', 'brightness', 'dimmwert', 'dim value', 'dim level'],
|
|
44
|
+
};
|
|
45
|
+
const blindSignal = {
|
|
46
|
+
label: 'Jalousieposition', read: ['value.blind', 'value.position.blind'], write: ['level.blind', 'level.position.blind'],
|
|
47
|
+
keywords: ['jalousie', 'jalousieposition', 'rollladen', 'rolladen', 'rollladenposition', 'raffstore', 'blind', 'blind position', 'shutter', 'shutter position'],
|
|
48
|
+
};
|
|
49
|
+
const tiltSignal = {
|
|
50
|
+
label: 'Lamellenposition', read: ['value.tilt', 'value.open.tilt'], write: ['level.tilt', 'level.open.tilt'],
|
|
51
|
+
keywords: ['lamellen', 'lamellenposition', 'lamellenwinkel', 'slat', 'slat angle', 'tilt'],
|
|
52
|
+
};
|
|
53
|
+
const climateSignal = {
|
|
54
|
+
label: 'Temperatur', read: ['value.temperature'], write: ['level.temperature'],
|
|
55
|
+
keywords: ['temperatur', 'temperature', 'isttemperatur', 'actual temperature', 'solltemperatur', 'target temperature', 'setpoint'],
|
|
56
|
+
};
|
|
57
|
+
const humiditySignal = {
|
|
58
|
+
label: 'Luftfeuchte', read: ['value.humidity', 'value.humidity.relative'], write: [],
|
|
59
|
+
keywords: ['luftfeuchte', 'luftfeuchtigkeit', 'relative feuchte', 'humidity', 'relative humidity'],
|
|
60
|
+
};
|
|
61
|
+
const temperatureProfiles = new Set(['temperature', 'thermostat', 'airCondition', 'weatherCurrent']);
|
|
62
|
+
const lightProfiles = new Set(['dimmer', 'rgb', 'rgbSingle', 'rgbwSingle', 'cie', 'ct', 'hue']);
|
|
63
|
+
const blindProfiles = new Set(['blind', 'blindButtons']);
|
|
64
|
+
const statusSignals = new Map([
|
|
65
|
+
['UNREACH', { label: 'Erreichbarkeit', read: ['indicator.maintenance.unreach', 'indicator.unreach'], write: [], keywords: ['erreichbarkeit', 'nicht erreichbar', 'unreachable', 'offline'] }],
|
|
66
|
+
['ERROR', { label: 'Störung', read: ['indicator.error'], write: [], keywords: ['störung', 'fehler', 'fault', 'error'] }],
|
|
67
|
+
['WORKING', { label: 'Betriebsstatus', read: ['indicator.working'], write: [], keywords: ['betrieb', 'in betrieb', 'working', 'running'] }],
|
|
68
|
+
['DIRECTION', { label: 'Fahrtrichtung', read: ['indicator.direction', 'value.direction'], write: [], keywords: ['fahrtrichtung', 'direction'] }],
|
|
69
|
+
['LOWBAT', { label: 'Batteriestatus', read: ['indicator.maintenance.lowbat', 'indicator.maintenance.battery'], write: [], keywords: ['batterie schwach', 'low battery', 'lowbat'] }],
|
|
70
|
+
['BATTERY', { label: 'Batteriestand', read: ['value.battery'], write: [], keywords: ['batteriestand', 'battery level', 'battery'] }],
|
|
71
|
+
]);
|
|
29
72
|
const forbidden = new Set(['__proto__', 'prototype', 'constructor']);
|
|
30
73
|
const maxFields = 128;
|
|
31
74
|
const maxResponseBytes = 1024 * 1024;
|
|
@@ -35,6 +78,85 @@
|
|
|
35
78
|
function record(value) {
|
|
36
79
|
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
37
80
|
}
|
|
81
|
+
function scalarType(value) {
|
|
82
|
+
return value === 'boolean' || value === 'number' || value === 'string';
|
|
83
|
+
}
|
|
84
|
+
function normalizeWords(value) {
|
|
85
|
+
return value.normalize('NFKD').replace(/\p{M}/gu, '').replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
86
|
+
.toLowerCase().replace(/ß/g, 'ss').replace(/[^a-z0-9]+/g, ' ').trim();
|
|
87
|
+
}
|
|
88
|
+
/** Die Schlüssel SET und ACTUAL erhalten ihre Bedeutung erst im konkreten Bedienprofil. */
|
|
89
|
+
function signalFor(profile, field) {
|
|
90
|
+
if (field === 'HUMIDITY' || (profile === 'humidity' && field === 'ACTUAL') || (profile === 'temperature' && field === 'SECOND'))
|
|
91
|
+
return humiditySignal;
|
|
92
|
+
if (temperatureProfiles.has(profile) && (field === 'ACTUAL' || field === 'SET'))
|
|
93
|
+
return climateSignal;
|
|
94
|
+
if (field === 'SET_HEATING' || field === 'SET_COOLING') {
|
|
95
|
+
const heating = field === 'SET_HEATING';
|
|
96
|
+
return { ...climateSignal, write: [heating ? 'level.temperature.heating' : 'level.temperature.cooling'] };
|
|
97
|
+
}
|
|
98
|
+
if (['ON_SET', 'ON_ACTUAL', 'ON', 'POWER'].includes(field) || (['light', 'socket'].includes(profile) && ['SET', 'ACTUAL'].includes(field)))
|
|
99
|
+
return switchSignal;
|
|
100
|
+
if (lightProfiles.has(profile) && ['SET', 'ACTUAL', 'DIMMER', 'BRIGHTNESS'].includes(field))
|
|
101
|
+
return dimmerSignal;
|
|
102
|
+
if (blindProfiles.has(profile)) {
|
|
103
|
+
if (['SET', 'ACTUAL'].includes(field))
|
|
104
|
+
return blindSignal;
|
|
105
|
+
if (['TILT_SET', 'TILT_ACTUAL'].includes(field))
|
|
106
|
+
return tiltSignal;
|
|
107
|
+
if (['OPEN', 'CLOSE', 'STOP', 'TILT_OPEN', 'TILT_CLOSE', 'TILT_STOP'].includes(field)) {
|
|
108
|
+
const [action, target] = field.startsWith('TILT_') ? [field.slice(5).toLowerCase(), 'tilt'] : [field.toLowerCase(), 'blind'];
|
|
109
|
+
const keywords = action === 'open' ? ['auf', 'öffnen', 'open', 'up'] : action === 'close' ? ['ab', 'schließen', 'close', 'down'] : ['stopp', 'stop', 'halt'];
|
|
110
|
+
return { label: '', read: [], write: [`button.${action}.${target}`, `action.${action}.${target}`], keywords };
|
|
111
|
+
}
|
|
112
|
+
if (field === 'DIRECTION_ENUM')
|
|
113
|
+
return statusSignals.get('DIRECTION');
|
|
114
|
+
}
|
|
115
|
+
if (field === 'ACTUAL') {
|
|
116
|
+
if (profile === 'contact' || profile === 'door' || profile === 'window') {
|
|
117
|
+
return { label: 'Kontaktstatus', read: [`sensor.${profile}`], write: [], keywords: ['kontakt', 'fensterkontakt', 'türkontakt', 'contact', 'window contact', 'door contact'] };
|
|
118
|
+
}
|
|
119
|
+
if (profile === 'motion')
|
|
120
|
+
return { label: 'Bewegung', read: ['sensor.motion'], write: [], keywords: ['bewegung', 'bewegungsmelder', 'motion', 'motion sensor'] };
|
|
121
|
+
}
|
|
122
|
+
return statusSignals.get(field);
|
|
123
|
+
}
|
|
124
|
+
function pickerHint(profile, field, direction) {
|
|
125
|
+
if (!field.types.length)
|
|
126
|
+
return undefined;
|
|
127
|
+
const signal = signalFor(profile, field.key);
|
|
128
|
+
const specific = signal?.label && field.label !== signal.label ? `${signal.label} · ${field.label}` : field.label;
|
|
129
|
+
return { label: specific, direction, types: field.types, unit: field.unit, roles: signal?.[direction] ?? [],
|
|
130
|
+
keywords: (signal?.keywords ?? []).map(normalizeWords) };
|
|
131
|
+
}
|
|
132
|
+
/** Filtert vom Server gelieferte Objektmetadaten. Ein Name ist nur ein Prüfhinweis. */
|
|
133
|
+
function profileCandidate(value, hint) {
|
|
134
|
+
if (!record(value) || !dpId(value.id) || !scalarType(value.type) || !hint.types.includes(value.type) || value[hint.direction] !== true)
|
|
135
|
+
return null;
|
|
136
|
+
const role = typeof value.role === 'string' ? value.role.trim().toLowerCase().slice(0, 128) : '';
|
|
137
|
+
const unit = typeof value.unit === 'string' ? value.unit.trim().slice(0, 40) : '';
|
|
138
|
+
const actualUnit = unit.normalize('NFKC').toLowerCase();
|
|
139
|
+
const profileUnit = hint.unit.normalize('NFKC').trim().toLowerCase();
|
|
140
|
+
// Messwerte zeigen ihre Quell-Einheit an. Befehle rechnen keine Einheiten um.
|
|
141
|
+
const temperatureReading = hint.direction === 'read' && profileUnit === '°c'
|
|
142
|
+
&& hint.roles.includes('value.temperature') && temperatureUnits.has(actualUnit);
|
|
143
|
+
if (actualUnit && profileUnit && actualUnit !== profileUnit && !temperatureReading)
|
|
144
|
+
return null;
|
|
145
|
+
const name = typeof value.name === 'string' ? value.name.slice(0, 300) : '';
|
|
146
|
+
const roleMatch = hint.roles.includes(role);
|
|
147
|
+
let nameMatch = false;
|
|
148
|
+
if (!roleMatch && genericRoles.has(role) && hint.keywords.length) {
|
|
149
|
+
const text = ` ${normalizeWords(`${value.id} ${name}`)} `;
|
|
150
|
+
nameMatch = hint.keywords.some(keyword => text.includes(` ${keyword} `));
|
|
151
|
+
}
|
|
152
|
+
return { id: value.id, name, role, type: value.type, unit, read: value.read === true, write: value.write === true,
|
|
153
|
+
match: roleMatch ? 'role' : nameMatch ? 'name' : 'type' };
|
|
154
|
+
}
|
|
155
|
+
/** Deutsche und englische Funktionsbegriffe führen zum selben Profilfilter. Ortsnamen und IDs bleiben echte Suchbegriffe. */
|
|
156
|
+
function profileSearchQuery(query, hint) {
|
|
157
|
+
const normalized = normalizeWords(query);
|
|
158
|
+
return hint.keywords.includes(normalized) || directionTerms[hint.direction].includes(normalized) ? '' : query;
|
|
159
|
+
}
|
|
38
160
|
function key(value) {
|
|
39
161
|
return typeof value === 'string' && /^[A-Za-z][A-Za-z0-9_-]{0,79}$/.test(value) && !forbidden.has(value);
|
|
40
162
|
}
|
|
@@ -101,7 +223,10 @@
|
|
|
101
223
|
if (!record(field) || !fieldKey(field.key) || seen.has(field.key) || typeof field.label !== 'string' || field.label.length > 240 || typeof field.type !== 'string' || field.type.length > 32 || typeof field.read !== 'boolean' || typeof field.write !== 'boolean')
|
|
102
224
|
throw new Error('Der Bedienprofil-Katalog enthält ungültige Felder.');
|
|
103
225
|
seen.add(field.key);
|
|
104
|
-
|
|
226
|
+
const allowedTypes = field.types;
|
|
227
|
+
const types = Array.isArray(allowedTypes) ? scalarTypes.filter(type => allowedTypes.includes(type))
|
|
228
|
+
: scalarType(field.type) ? [field.type] : field.type === 'mixed' ? scalarTypes : [];
|
|
229
|
+
return { key: field.key, label: field.label, type: field.type, types, read: field.read, write: field.write,
|
|
105
230
|
unit: typeof field.unit === 'string' ? field.unit.slice(0, 40) : '', required: field.required === true };
|
|
106
231
|
});
|
|
107
232
|
return { id: profile.id, label: profile.label, fields };
|
|
@@ -117,7 +242,7 @@
|
|
|
117
242
|
if (template)
|
|
118
243
|
return { ...template, key: name, label: `${template.label} · ${name.slice(template.key.length - 2)}` };
|
|
119
244
|
if (profile.id === 'universal' && fieldKey(name))
|
|
120
|
-
return { key: name, label: name, type: 'mixed', unit: '', read: true, write: true, required: false };
|
|
245
|
+
return { key: name, label: name, type: 'mixed', types: scalarTypes, unit: '', read: true, write: true, required: false };
|
|
121
246
|
return undefined;
|
|
122
247
|
}
|
|
123
248
|
async function readCatalog() {
|
|
@@ -287,7 +412,7 @@
|
|
|
287
412
|
}
|
|
288
413
|
const known = new Set((current?.fields || []).map(field => field.key));
|
|
289
414
|
const extra = mapping.fields.filter(field => !known.has(field.key));
|
|
290
|
-
const sourceFields = [...(current?.fields || []), ...extra.map(row => fieldFor(current, row.key) || { key: row.key, label: row.key, type: 'unbekannt', unit: '', read: true, write: true, required: false })];
|
|
415
|
+
const sourceFields = [...(current?.fields || []), ...extra.map(row => fieldFor(current, row.key) || { key: row.key, label: row.key, type: 'unbekannt', types: [], unit: '', read: true, write: true, required: false })];
|
|
291
416
|
function addField(name) {
|
|
292
417
|
if (!mapping || !fieldKey(name) || !fieldFor(current, name))
|
|
293
418
|
return;
|
|
@@ -405,7 +530,7 @@
|
|
|
405
530
|
next.fields = next.fields.filter(item => item.readId || item.writeId);
|
|
406
531
|
}
|
|
407
532
|
commit(next);
|
|
408
|
-
});
|
|
533
|
+
}, current && !unknown && enabled ? pickerHint(current.id, field, direction === 'readId' ? 'read' : 'write') : undefined);
|
|
409
534
|
if (!enabled || unknown)
|
|
410
535
|
picker.appendChild(element('p', 'nw-sh-profile__warning', 'Diese Zuordnung wird vom aktuellen Profil nicht unterstützt. Entfernen oder ein passendes Profil auswählen.'));
|
|
411
536
|
row.appendChild(picker);
|
|
@@ -457,5 +582,5 @@
|
|
|
457
582
|
ensureLoaded();
|
|
458
583
|
}
|
|
459
584
|
async function loadCustomViews() { await load(); return customViews; }
|
|
460
|
-
host.NW_SH_DEVICE_CONFIG = Object.freeze({ mount, validationError, loadCustomViews });
|
|
585
|
+
host.NW_SH_DEVICE_CONFIG = Object.freeze({ mount, validationError, loadCustomViews, profileCandidate, profileSearchQuery });
|
|
461
586
|
})();
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/www/smarthome-setup.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:58c4a10e1d6f2d999e9fd804c44f72fda44f63dd739dbd28825c7be1c6e8a012
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -126,6 +126,102 @@
|
|
|
126
126
|
const name = (row) => text(row.alias) || text(row.name) || text(row.id, 'Unbenannt');
|
|
127
127
|
const types = { device: 'Gerät', switch: 'Schalter', dimmer: 'Dimmer', color: 'Farblicht', blind: 'Beschattung', rtr: 'Raumklima', sensor: 'Sensor', player: 'Medien', camera: 'Kamera', scene: 'Szene', widget: 'Widget', logicStatus: 'Logikstatus' };
|
|
128
128
|
const typeLabel = (value) => typeof value === 'string' && Object.hasOwn(types, value) ? types[value] || 'Gerät' : text(value, 'Gerät');
|
|
129
|
+
const discoveryFolders = [
|
|
130
|
+
{ id: 'all', label: 'Alle Geräte', keywords: '' },
|
|
131
|
+
{ id: 'switch', label: 'Schalten', keywords: 'schalter licht lampe steckdose ein aus an switch on off relay light lamp socket outlet' },
|
|
132
|
+
{ id: 'dimmer', label: 'Dimmen', keywords: 'dimmer dimmwert helligkeit lichtstärke dimming brightness light level' },
|
|
133
|
+
{ id: 'blind', label: 'Jalousie & Rollladen', keywords: 'jalousien rollläden rolladen rollo rollos raffstore beschattung blind blinds shutter roller shade' },
|
|
134
|
+
{ id: 'climate', label: 'Temperatur & Klima', keywords: 'heizung raumklima thermostat temperature climate heating' },
|
|
135
|
+
{ id: 'status', label: 'Status & Sensoren', keywords: 'zustand rückmeldung rueckmeldung messwert feedback actual status sensor' },
|
|
136
|
+
{ id: 'other', label: 'Weitere Funktionen', keywords: 'weitere sonstige other additional' },
|
|
137
|
+
{ id: 'review', label: 'Manuell prüfen', keywords: 'mehrdeutig unklar pruefen review manual ambiguous' },
|
|
138
|
+
];
|
|
139
|
+
const searchMaxLength = 512;
|
|
140
|
+
// These words describe existing fields. Shared profile keys such as SET and
|
|
141
|
+
// ACTUAL need a specific device profile or an explicit ioBroker role.
|
|
142
|
+
const fieldKeywords = new Map([
|
|
143
|
+
['OPEN', 'auf öffnen auffahren open raise'], ['CLOSE', 'ab schließen abfahren close lower'], ['STOP', 'stopp anhalten stop'],
|
|
144
|
+
['TILT_SET', 'lamellenwinkel lamellen tilt slats'], ['TILT_ACTUAL', 'lamellenstatus lamellen tilt slats feedback'],
|
|
145
|
+
['TILT_OPEN', 'lamellen öffnen open slats'], ['TILT_CLOSE', 'lamellen schließen close slats'], ['TILT_STOP', 'lamellen stopp stop slats'],
|
|
146
|
+
['ON_ACTUAL', 'schaltstatus schaltzustand switch state'], ['HUMIDITY', 'luftfeuchte humidity'], ['LOWBAT', 'batterie schwach low battery'],
|
|
147
|
+
['BATTERY', 'batterie battery'], ['UNREACH', 'erreichbarkeit erreichbar reachability reachable offline'], ['ERROR', 'störung fehler fault error'],
|
|
148
|
+
['blind:SET', 'sollposition rollladenposition position setzen target position'], ['blind:ACTUAL', 'istposition rollladenposition positionsstatus actual position'],
|
|
149
|
+
['thermostat:SET', 'solltemperatur sollwert setpoint target temperature'], ['thermostat:ACTUAL', 'isttemperatur istwert actual temperature'],
|
|
150
|
+
['temperature:ACTUAL', 'isttemperatur istwert actual temperature'], ['humidity:ACTUAL', 'luftfeuchte humidity'],
|
|
151
|
+
['level.blind', 'sollposition rollladenposition position setzen target position'], ['value.blind', 'istposition rollladenposition positionsstatus actual position'],
|
|
152
|
+
['level.temperature', 'solltemperatur sollwert setpoint target temperature'], ['value.temperature', 'isttemperatur istwert actual temperature'],
|
|
153
|
+
['value.humidity', 'luftfeuchte humidity'], ['sensor.window', 'fensterkontakt fenster window contact'], ['sensor.door', 'türkontakt tür door contact'],
|
|
154
|
+
['sensor.motion', 'bewegung bewegungsmelder motion occupancy'],
|
|
155
|
+
]);
|
|
156
|
+
const filterText = (value) => value.toLocaleLowerCase('de').replace(/ß/g, 'ss').normalize('NFKD').replace(/\p{M}/gu, '');
|
|
157
|
+
function discoveryMembership(row) {
|
|
158
|
+
const supplied = Array.isArray(row.functionCategories) ? row.functionCategories : [];
|
|
159
|
+
const categories = new Set(['all']);
|
|
160
|
+
for (const folder of discoveryFolders) {
|
|
161
|
+
if (supplied.includes(folder.id))
|
|
162
|
+
categories.add(folder.id);
|
|
163
|
+
}
|
|
164
|
+
if (categories.size === 1) {
|
|
165
|
+
// Older detection responses already carry a validated device profile.
|
|
166
|
+
// Profile names here affect presentation only, never a data point mapping.
|
|
167
|
+
const profile = text(row.detectorType).toLowerCase();
|
|
168
|
+
const kind = text(row.targetType);
|
|
169
|
+
if (['light', 'socket', 'switch'].includes(profile) || kind === 'switch')
|
|
170
|
+
categories.add('switch');
|
|
171
|
+
if (profile === 'dimmer' || kind === 'dimmer')
|
|
172
|
+
categories.add('dimmer');
|
|
173
|
+
if (['blind', 'blinds', 'blindbuttons'].includes(profile) || kind === 'blind')
|
|
174
|
+
categories.add('blind');
|
|
175
|
+
if (['temperature', 'humidity', 'thermostat'].includes(profile) || kind === 'rtr')
|
|
176
|
+
categories.add('climate');
|
|
177
|
+
if (kind === 'sensor' || rows(row.states).some(state => state.indicator === true || (state.read === true && state.write !== true)))
|
|
178
|
+
categories.add('status');
|
|
179
|
+
if (categories.size === 1)
|
|
180
|
+
categories.add('other');
|
|
181
|
+
}
|
|
182
|
+
if (row.importable !== true || row.discoveryReview === true)
|
|
183
|
+
categories.add('review');
|
|
184
|
+
return categories;
|
|
185
|
+
}
|
|
186
|
+
function sourceInstance(value) {
|
|
187
|
+
const match = /^([a-z0-9_-]+\.\d+)(?:\.|$)/i.exec(text(value));
|
|
188
|
+
return match?.[1] || '';
|
|
189
|
+
}
|
|
190
|
+
function discoveryItems(input) {
|
|
191
|
+
const result = new Map();
|
|
192
|
+
const candidates = Array.isArray(input) ? input.slice(0, 10000) : [];
|
|
193
|
+
for (const candidate of candidates) {
|
|
194
|
+
if (!record(candidate))
|
|
195
|
+
continue;
|
|
196
|
+
const key = id(candidate.id);
|
|
197
|
+
if (!key || result.has(key))
|
|
198
|
+
continue;
|
|
199
|
+
const sources = [...new Set([sourceInstance(candidate.sourceId), sourceInstance(candidate.displaySourceId)].filter(Boolean))];
|
|
200
|
+
const metadata = record(candidate.metadata) ? candidate.metadata : {};
|
|
201
|
+
const roomOptions = rows(metadata.rooms).slice(0, 32).flatMap(room => {
|
|
202
|
+
const value = id(room.enumId) || id(room.id);
|
|
203
|
+
return value && value !== '__none__' ? [{ value, label: text(room.name, value) }] : [];
|
|
204
|
+
});
|
|
205
|
+
result.set(key, { row: candidate, id: key, folders: discoveryMembership(candidate), sources, roomOptions });
|
|
206
|
+
}
|
|
207
|
+
return [...result.values()];
|
|
208
|
+
}
|
|
209
|
+
function discoverySearchText(item) {
|
|
210
|
+
const { row } = item;
|
|
211
|
+
const detectedType = text(row.detectorType).toLowerCase();
|
|
212
|
+
const profile = detectedType === 'blinds' || detectedType === 'blindbuttons' ? 'blind' : detectedType;
|
|
213
|
+
return filterText([
|
|
214
|
+
name(row), text(row.displayName), text(row.sourceName), id(row.sourceId).slice(0, searchMaxLength), id(row.displaySourceId).slice(0, searchMaxLength), detectedType, typeLabel(row.targetType),
|
|
215
|
+
...item.roomOptions.map(room => room.label),
|
|
216
|
+
...discoveryFolders.filter(folder => item.folders.has(folder.id)).map(folder => `${folder.label} ${folder.keywords}`),
|
|
217
|
+
...rows(row.states).slice(0, 128).map(state => {
|
|
218
|
+
const key = text(state.key);
|
|
219
|
+
const role = text(state.role);
|
|
220
|
+
const words = fieldKeywords.get(`${profile}:${key}`) || fieldKeywords.get(key) || fieldKeywords.get(role) || '';
|
|
221
|
+
return `${id(state.id).slice(0, searchMaxLength)} ${key} ${text(state.label)} ${role} ${words}`;
|
|
222
|
+
}),
|
|
223
|
+
].join(' '));
|
|
224
|
+
}
|
|
129
225
|
function mountSetup(container, options) {
|
|
130
226
|
container.replaceChildren();
|
|
131
227
|
const config = record(options.config) ? options.config : {};
|
|
@@ -203,21 +299,30 @@
|
|
|
203
299
|
function mountDetection(container, options) {
|
|
204
300
|
container.replaceChildren();
|
|
205
301
|
const p = options.preferences;
|
|
206
|
-
const suggestions =
|
|
302
|
+
const suggestions = discoveryItems(options.suggestions);
|
|
207
303
|
const rooms = rows(options.rooms);
|
|
208
|
-
const selected = new Set(p.selected || []);
|
|
209
304
|
const eligible = (row) => row.importable === true && row.imported !== true && row.alreadyConfigured !== true;
|
|
305
|
+
const eligibleIds = new Set(suggestions.filter(item => eligible(item.row)).map(item => item.id));
|
|
306
|
+
const selected = new Set((p.selected || []).filter(key => eligibleIds.has(key)).slice(0, 100));
|
|
307
|
+
p.selected = [...selected];
|
|
308
|
+
let folder = discoveryFolders.find(item => item.id === p.folder)?.id ?? 'all';
|
|
309
|
+
let page = 0;
|
|
310
|
+
const pageSize = 100;
|
|
311
|
+
const searchIndex = new Map();
|
|
312
|
+
let visiblePage = [];
|
|
210
313
|
const toolbar = el('div', 'nw-setup-detection-toolbar');
|
|
211
314
|
const search = el('input', 'nw-config-input');
|
|
212
315
|
search.type = 'search';
|
|
316
|
+
search.maxLength = searchMaxLength;
|
|
213
317
|
search.value = p.query || '';
|
|
214
|
-
search.placeholder = '
|
|
318
|
+
search.placeholder = 'Gerät, Funktion oder Datenpunkt suchen …';
|
|
215
319
|
search.setAttribute('aria-label', 'Erkannte Geräte suchen');
|
|
216
320
|
toolbar.appendChild(search);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
321
|
+
const targetRooms = [{ value: '', label: 'Bitte Zielraum auswählen' }, { value: '__none__', label: 'Ohne Raum übernehmen' },
|
|
322
|
+
...rooms.map(room => ({ value: id(room.id), label: name(room) }))];
|
|
323
|
+
if (!targetRooms.some(room => room.value === p.roomId))
|
|
324
|
+
p.roomId = '';
|
|
325
|
+
toolbar.appendChild(selectField('Zielraum für die Auswahl', targetRooms, p.roomId || '', value => { p.roomId = value; refreshActions(); }));
|
|
221
326
|
const aliases = el('label', 'nw-setup-check');
|
|
222
327
|
const alias = el('input');
|
|
223
328
|
alias.type = 'checkbox';
|
|
@@ -225,30 +330,79 @@
|
|
|
225
330
|
alias.disabled = !options.canAlias || !!options.busy;
|
|
226
331
|
p.useAliases = alias.checked;
|
|
227
332
|
alias.addEventListener('change', () => { p.useAliases = alias.checked; });
|
|
228
|
-
aliases.
|
|
229
|
-
aliases.appendChild(el('span', '', 'Alias-Datenpunkte verwenden/anlegen' + (options.canAlias ? '' : ' (Berechtigung zur Gerätezuordnung erforderlich)')));
|
|
333
|
+
aliases.append(alias, el('span', '', 'Alias-Datenpunkte verwenden/anlegen' + (options.canAlias ? '' : ' (Berechtigung zur Gerätezuordnung erforderlich)')));
|
|
230
334
|
toolbar.appendChild(aliases);
|
|
231
335
|
const configured = el('label', 'nw-setup-check');
|
|
232
336
|
const show = el('input');
|
|
233
337
|
show.type = 'checkbox';
|
|
234
338
|
show.checked = !!p.showConfigured;
|
|
235
|
-
configured.
|
|
236
|
-
configured.appendChild(el('span', '', 'Bereits zugeordnete Geräte zeigen'));
|
|
339
|
+
configured.append(show, el('span', '', 'Bereits zugeordnete Geräte zeigen'));
|
|
237
340
|
toolbar.appendChild(configured);
|
|
238
341
|
container.appendChild(toolbar);
|
|
342
|
+
const sources = new Set();
|
|
343
|
+
const detectedRooms = new Map();
|
|
344
|
+
for (const item of suggestions) {
|
|
345
|
+
for (const source of item.sources)
|
|
346
|
+
sources.add(source);
|
|
347
|
+
for (const room of item.roomOptions)
|
|
348
|
+
detectedRooms.set(room.value, room.label);
|
|
349
|
+
}
|
|
350
|
+
if (sources.size || detectedRooms.size) {
|
|
351
|
+
const filters = el('details', 'nw-setup-detection-filters');
|
|
352
|
+
filters.open = !!(p.filtersOpen || p.sourceFilter || p.roomFilter);
|
|
353
|
+
filters.addEventListener('toggle', () => { p.filtersOpen = filters.open; });
|
|
354
|
+
filters.appendChild(el('summary', '', 'Nach Raum oder Adapter filtern'));
|
|
355
|
+
const fields = el('div', 'nw-setup-detection-toolbar');
|
|
356
|
+
// Keep filter controls small even for very large object lists. Search can
|
|
357
|
+
// still reach every room name and source outside the first 100 options.
|
|
358
|
+
const sourceOptions = [...sources].sort((a, b) => a.localeCompare(b, 'de')).slice(0, 100).map(value => ({ value, label: value }));
|
|
359
|
+
const roomOptions = [...detectedRooms].sort((a, b) => a[1].localeCompare(b[1], 'de')).slice(0, 100).map(([value, label]) => ({ value, label }));
|
|
360
|
+
if (!sourceOptions.some(option => option.value === p.sourceFilter))
|
|
361
|
+
p.sourceFilter = '';
|
|
362
|
+
if (p.roomFilter !== '__none__' && !roomOptions.some(option => option.value === p.roomFilter))
|
|
363
|
+
p.roomFilter = '';
|
|
364
|
+
fields.appendChild(selectField('Adapter', [{ value: '', label: 'Alle Adapter' }, ...sourceOptions], p.sourceFilter || '', value => { p.sourceFilter = value; resetPage(); }));
|
|
365
|
+
fields.appendChild(selectField('Erkannter Raum', [{ value: '', label: 'Alle erkannten Räume' }, { value: '__none__', label: 'Ohne erkannten Raum' }, ...roomOptions], p.roomFilter || '', value => { p.roomFilter = value; resetPage(); }));
|
|
366
|
+
filters.appendChild(fields);
|
|
367
|
+
container.appendChild(filters);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
p.sourceFilter = '';
|
|
371
|
+
p.roomFilter = '';
|
|
372
|
+
}
|
|
373
|
+
if (options.busy)
|
|
374
|
+
for (const select of container.querySelectorAll('select'))
|
|
375
|
+
select.disabled = true;
|
|
376
|
+
const folders = el('div', 'nw-setup-detection-folders');
|
|
377
|
+
folders.setAttribute('role', 'group');
|
|
378
|
+
folders.setAttribute('aria-label', 'Funktionsordner');
|
|
379
|
+
const folderControls = discoveryFolders.map(item => {
|
|
380
|
+
const control = button(item.label, () => { folder = item.id; p.folder = folder; resetPage(); });
|
|
381
|
+
control.classList.add('nw-setup-detection-folder');
|
|
382
|
+
control.dataset.detectionFolder = item.id;
|
|
383
|
+
const total = el('span', 'nw-setup-detection-folder-count');
|
|
384
|
+
control.appendChild(total);
|
|
385
|
+
folders.appendChild(control);
|
|
386
|
+
return { id: item.id, control, total };
|
|
387
|
+
});
|
|
388
|
+
container.appendChild(folders);
|
|
239
389
|
const actions = el('div', 'nw-setup-batch-actions');
|
|
240
390
|
const count = el('span');
|
|
241
|
-
actions.appendChild(count);
|
|
242
391
|
const importButton = button('Auswahl übernehmen', () => options.onImport([...selected], p.roomId || ''), true);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
392
|
+
const selectAll = button('Diese Seite auswählen', () => {
|
|
393
|
+
const candidates = visiblePage.filter(item => eligibleIds.has(item.id)).map(item => item.id);
|
|
394
|
+
const union = new Set([...selected, ...candidates]);
|
|
395
|
+
if (union.size > 100) {
|
|
396
|
+
status.textContent = 'Maximal 100 Geräte je Übernahme auswählen.';
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
for (const key of candidates)
|
|
400
|
+
selected.add(key);
|
|
401
|
+
p.selected = [...selected];
|
|
402
|
+
render();
|
|
403
|
+
});
|
|
249
404
|
const clear = button('Auswahl aufheben', () => { selected.clear(); p.selected = []; render(); });
|
|
250
|
-
|
|
251
|
-
actions.appendChild(clear);
|
|
405
|
+
actions.append(count, importButton, selectAll, clear);
|
|
252
406
|
container.appendChild(actions);
|
|
253
407
|
const status = el('p', 'nw-setup-status');
|
|
254
408
|
status.setAttribute('role', 'status');
|
|
@@ -257,62 +411,101 @@
|
|
|
257
411
|
const list = el('div', 'nw-setup-detection-list');
|
|
258
412
|
container.appendChild(list);
|
|
259
413
|
const pagination = el('div', 'nw-setup-pagination');
|
|
414
|
+
const previous = button('Zurück', () => { page--; render(); });
|
|
415
|
+
const pageStatus = el('span');
|
|
416
|
+
const next = button('Weiter', () => { page++; render(); });
|
|
417
|
+
pagination.append(previous, pageStatus, next);
|
|
260
418
|
container.appendChild(pagination);
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
419
|
+
function matching() {
|
|
420
|
+
const terms = filterText(search.value.slice(0, searchMaxLength)).trim().split(/\s+/).filter(Boolean);
|
|
421
|
+
return suggestions.filter(item => {
|
|
422
|
+
const row = item.row;
|
|
423
|
+
if (!p.showConfigured && (row.imported === true || (row.alreadyConfigured === true && !(record(row.update) && row.update.sourceChanged === true))))
|
|
424
|
+
return false;
|
|
425
|
+
if (p.sourceFilter && !item.sources.includes(p.sourceFilter))
|
|
426
|
+
return false;
|
|
427
|
+
if (p.roomFilter === '__none__' && item.roomOptions.length)
|
|
428
|
+
return false;
|
|
429
|
+
if (p.roomFilter && p.roomFilter !== '__none__' && !item.roomOptions.some(room => room.value === p.roomFilter))
|
|
430
|
+
return false;
|
|
431
|
+
if (!terms.length)
|
|
432
|
+
return true;
|
|
433
|
+
let index = searchIndex.get(item.id);
|
|
434
|
+
if (index === undefined) {
|
|
435
|
+
index = discoverySearchText(item);
|
|
436
|
+
searchIndex.set(item.id, index);
|
|
437
|
+
}
|
|
438
|
+
return terms.every(term => index.includes(term));
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
function resetPage() { page = 0; status.textContent = ''; render(); }
|
|
442
|
+
function refreshActions() {
|
|
443
|
+
count.textContent = `${selected.size} ausgewählt`;
|
|
444
|
+
importButton.disabled = !selected.size || !p.roomId || !!options.busy;
|
|
445
|
+
selectAll.disabled = !!options.busy || !visiblePage.some(item => eligibleIds.has(item.id) && !selected.has(item.id));
|
|
446
|
+
clear.disabled = !selected.size || !!options.busy;
|
|
266
447
|
}
|
|
267
|
-
function refreshActions() { count.textContent = `${selected.size} ausgewählt`; importButton.disabled = !selected.size || !p.roomId || !!options.busy; selectAll.disabled = !!options.busy; }
|
|
268
448
|
function render() {
|
|
269
449
|
list.replaceChildren();
|
|
450
|
+
const matches = matching();
|
|
451
|
+
const totals = new Map();
|
|
452
|
+
for (const item of matches)
|
|
453
|
+
for (const key of item.folders)
|
|
454
|
+
totals.set(key, (totals.get(key) || 0) + 1);
|
|
455
|
+
for (const entry of folderControls) {
|
|
456
|
+
entry.control.setAttribute('aria-pressed', String(entry.id === folder));
|
|
457
|
+
entry.total.textContent = ` ${totals.get(entry.id) || 0}`;
|
|
458
|
+
}
|
|
459
|
+
const activeItems = matches.filter(item => item.folders.has(folder));
|
|
460
|
+
const pageCount = Math.max(1, Math.ceil(activeItems.length / pageSize));
|
|
461
|
+
page = Math.min(Math.max(0, page), pageCount - 1);
|
|
462
|
+
visiblePage = activeItems.slice(page * pageSize, (page + 1) * pageSize);
|
|
270
463
|
refreshActions();
|
|
271
|
-
const visibleRows = visible();
|
|
272
|
-
page = Math.min(page, Math.max(0, Math.ceil(visibleRows.length / pageSize) - 1));
|
|
273
|
-
pagination.replaceChildren();
|
|
274
|
-
const previous = button('Zurück', () => { page--; render(); });
|
|
275
464
|
previous.disabled = page === 0 || !!options.busy;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
pagination.appendChild(next);
|
|
281
|
-
for (const item of visibleRows.slice(page * pageSize, (page + 1) * pageSize)) {
|
|
465
|
+
next.disabled = page >= pageCount - 1 || !!options.busy;
|
|
466
|
+
pageStatus.textContent = `${activeItems.length} Treffer · Seite ${page + 1} / ${pageCount}`;
|
|
467
|
+
for (const item of visiblePage) {
|
|
468
|
+
const entry = item.row;
|
|
282
469
|
const row = el('article', 'nw-setup-detection-row');
|
|
283
|
-
row.dataset.detectId =
|
|
470
|
+
row.dataset.detectId = item.id;
|
|
471
|
+
const displayName = text(entry.displayName, name(entry));
|
|
284
472
|
const check = el('input');
|
|
285
473
|
check.type = 'checkbox';
|
|
286
|
-
check.checked = selected.has(
|
|
287
|
-
check.disabled = !
|
|
288
|
-
check.setAttribute('aria-label', `${
|
|
289
|
-
check.addEventListener('change', () => {
|
|
290
|
-
check.checked
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
474
|
+
check.checked = selected.has(item.id);
|
|
475
|
+
check.disabled = !eligibleIds.has(item.id) || !!options.busy;
|
|
476
|
+
check.setAttribute('aria-label', `${displayName} auswählen`);
|
|
477
|
+
check.addEventListener('change', () => {
|
|
478
|
+
if (check.checked && selected.size >= 100) {
|
|
479
|
+
check.checked = false;
|
|
480
|
+
status.textContent = 'Maximal 100 Geräte je Übernahme auswählen.';
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
if (check.checked)
|
|
484
|
+
selected.add(item.id);
|
|
485
|
+
else
|
|
486
|
+
selected.delete(item.id);
|
|
487
|
+
p.selected = [...selected];
|
|
488
|
+
refreshActions();
|
|
489
|
+
});
|
|
297
490
|
row.appendChild(check);
|
|
298
491
|
const info = el('div', 'nw-setup-device-info');
|
|
299
|
-
|
|
300
|
-
info.
|
|
301
|
-
const sample = rows(
|
|
302
|
-
info.appendChild(el('small', '', sample || text(
|
|
492
|
+
const location = [typeLabel(entry.targetType), item.roomOptions[0]?.label, item.sources[0]].filter(Boolean).join(' · ');
|
|
493
|
+
info.append(el('strong', '', displayName), el('span', '', location));
|
|
494
|
+
const sample = rows(entry.states).slice(0, 2).map(state => `${text(state.label) || text(state.key)} → ${text(state.id)}`).join(' · ');
|
|
495
|
+
info.appendChild(el('small', '', sample || text(entry.sourceId)));
|
|
303
496
|
row.appendChild(info);
|
|
304
|
-
const state =
|
|
497
|
+
const state = entry.imported === true ? 'Übernommen' : record(entry.update) && entry.update.sourceChanged === true ? 'Änderungen prüfen' : entry.alreadyConfigured === true ? 'Bereits im Projekt' : item.folders.has('review') ? 'Manuell prüfen' : 'Bereit zur Übernahme';
|
|
305
498
|
row.appendChild(el('span', 'nw-setup-detection-state', state));
|
|
306
|
-
const detail = button('Details prüfen', () => options.onDetails(
|
|
499
|
+
const detail = button('Details prüfen', () => options.onDetails(item.id));
|
|
307
500
|
detail.disabled = !!options.busy;
|
|
308
501
|
row.appendChild(detail);
|
|
309
502
|
list.appendChild(row);
|
|
310
503
|
}
|
|
311
|
-
if (!
|
|
312
|
-
list.appendChild(el('p', 'nw-config-empty', 'Keine Vorschläge
|
|
504
|
+
if (!activeItems.length)
|
|
505
|
+
list.appendChild(el('p', 'nw-config-empty', 'Keine Vorschläge in diesem Ordner. Anderen Ordner wählen oder Filter anpassen.'));
|
|
313
506
|
}
|
|
314
|
-
show.addEventListener('change', () => { p.showConfigured = show.checked;
|
|
315
|
-
search.addEventListener('input', () => { p.query = search.value
|
|
507
|
+
show.addEventListener('change', () => { p.showConfigured = show.checked; resetPage(); });
|
|
508
|
+
search.addEventListener('input', () => { p.query = search.value.slice(0, searchMaxLength); resetPage(); });
|
|
316
509
|
render();
|
|
317
510
|
}
|
|
318
511
|
let active = null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ds as e,Hs as t}from"./loadShare-eager-dmdYQhAl.js";var n=e([t(`path`,{d:`M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8`},`0`),t(`path`,{d:`M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z`},`1`)],`AccessTime`);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ar as e,Hs as t,Ko as n,Tr as r,po as i,t as a}from"./loadShare-eager-dmdYQhAl.js";import{n as o,t as s}from"./PushPinOutlined-BCUm5DLR.js";import{N as c,P as l}from"./bootstrap-BU7j1Fe_.js";var u={root:{display:`block`,position:`relative`,left:0,top:0,width:`100%`,height:`100%`,color:`black`,borderRadius:4,boxShadow:`0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)`,border:`0px solid #888`},pinnedIcon:{color:`#ffca28`}},d={backgroundColor:`rgba(255, 255, 255, 0.25)`,"&:hover":{backgroundColor:`rgba(255, 255, 255, 0.35)`}},f=class extends e{constructor(t){super(t);let n=e.getLocation().id||window.localStorage.getItem(`dmSelectedInstance`)||``;this.state={instance:n,pinned:n?c(n):!1,listKey:n}}componentDidMount(){super.componentDidMount(),this.state.instance||this.detectSingleInstance()}async detectSingleInstance(){try{let e=await this.props.socket.getObjectViewSystem(`instance`,`system.adapter.`,`system.adapter.香`),t=Object.keys(e||{}).filter(t=>{var n;return(n=e[t])==null||(n=n.common)==null||(n=n.supportedMessages)==null?void 0:n.deviceManager}).map(e=>e.substring(15)),n=[];for(let e of t){let t=await this.props.socket.getState(`system.adapter.${e}.alive`);t!=null&&t.val&&n.push(e)}n.length===1&&!this.state.instance&&this.setState({instance:n[0],pinned:c(n[0])})}catch(e){console.error(`Cannot read the instances with a device manager: ${e}`)}}onHashChanged(){let t=e.getLocation().id;t&&t!==this.state.instance&&this.setState({instance:t,pinned:c(t),listKey:t})}renderPinButton(){return this.state.instance?t(i,{title:r.t(this.state.pinned?`Remove from navigation`:`Pin to navigation`),slotProps:{popper:{sx:{pointerEvents:`none`}}},children:t(n,{color:`inherit`,size:`small`,sx:{mr:1,...this.state.pinned?d:void 0},onClick:()=>{let e=!this.state.pinned;l(this.state.instance,e),this.setState({pinned:e})},children:this.state.pinned?t(o,{style:u.pinnedIcon}):t(s,{})})}):null}render(){return t(`div`,{style:u.root,children:t(a,{socket:this.props.socket,themeType:this.props.themeType,themeName:this.props.themeName,theme:this.props.theme,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,title:this.renderPinButton(),instance:this.state.instance,onInstanceChanged:t=>{this.setState({instance:t,pinned:t?c(t):!1}),e.doNavigate(`tab-devicemanager`,`tab`,t)}},this.state.listKey)})}};export{f as default};
|