iobroker.eos-admin 9.0.17 → 9.0.19
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 +11 -14
- package/README.md +7 -3
- package/START_HIER_9.0.18.md +47 -0
- package/START_HIER_9.0.19.md +52 -0
- package/adminWww/.vite/manifest.json +114 -114
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13759 -13759
- package/adminWww/assets/{AdapterUpdateDialog-Cpo3dAfY.js → AdapterUpdateDialog-JOf2z4Vg.js} +1 -1
- package/adminWww/assets/{Adapters-n2ukPDdC.js → Adapters-C9fcSdWm.js} +1 -1
- package/adminWww/assets/{ConfigManager-BVZ6_Ebo.js → ConfigManager-BeeLlT6D.js} +1 -1
- package/adminWww/assets/{Enums-CQ6yHG2W.js → Enums-FqnXWl8U.js} +1 -1
- package/adminWww/assets/{Fields-CaJqzoW-.js → Fields-DMgrt5Pi.js} +1 -1
- package/adminWww/assets/{Files-DfvpKGa3.js → Files-CIHtt12g.js} +1 -1
- package/adminWww/assets/{Hosts-3xLBsdG6.js → Hosts-fPLBzvTy.js} +1 -1
- package/adminWww/assets/{Instances-B7hKEhyw.js → Instances-4XaVQlrT.js} +1 -1
- package/adminWww/assets/{Intro-BV4kYZdT.js → Intro-5TKriiLO.js} +1 -1
- package/adminWww/assets/{Logs-DpL9eY69.js → Logs-33zcIds-.js} +1 -1
- package/adminWww/assets/{Objects-dN06jhQk.js → Objects-CNQPVbNG.js} +1 -1
- package/adminWww/assets/{Overview-Lip63_ej.js → Overview-BskXGOc8.js} +1 -1
- package/adminWww/assets/{State-BSO2X_xN.js → State-C8SJ_Iqo.js} +1 -1
- package/adminWww/assets/{UsedResources-DvqzszKI.js → UsedResources-CgqRa9ei.js} +1 -1
- package/adminWww/assets/{Users-Csqd1xA-.js → Users-0JVYWR9u.js} +1 -1
- package/adminWww/assets/{bootstrap-C3HM8kNL.js → bootstrap-D16lu6rd.js} +3 -3
- package/adminWww/assets/{hostInit-DdxBUeXQ.js → hostInit-C8YZJuzi.js} +1 -1
- package/adminWww/assets/{icons-material-D1Tb_725.js → icons-material-CiNJ_6Ur.js} +1 -1
- package/adminWww/assets/{index-BOujTMyH.js → index-DA9Sphgh.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-BZyrUVAo.js → installSVGRenderer-DPdkRa_d.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-3418586b.js → mf-entry-bootstrap-0-a7ab91de.js} +2 -2
- 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.17.js → remoteEntry-eos-9.0.19.js} +1 -1
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosCookieNamespace.js +12 -2
- package/build/lib/eosCookieNamespace.js.map +1 -1
- package/build/lib/eosDeviceEmsPlan.js +1147 -0
- package/build/lib/eosDeviceEmsPlan.js.map +1 -0
- package/build/lib/eosDeviceEmsService.js +473 -0
- package/build/lib/eosDeviceEmsService.js.map +1 -0
- package/build/lib/eosModuleHost.js +227 -51
- package/build/lib/eosModuleHost.js.map +1 -1
- package/build/lib/eosModuleHttp.js +1 -1
- package/build/lib/eosModuleHttp.js.map +1 -1
- package/build/lib/web.js +31 -0
- package/build/lib/web.js.map +1 -1
- package/docs/reports/unified-9.0.18/ALIAS_V1_COVERAGE.json +5056 -0
- package/docs/reports/unified-9.0.18/ALIAS_V1_VERTRAG.md +257 -0
- package/docs/reports/unified-9.0.18/ANFORDERUNGEN.md +55 -0
- package/docs/reports/unified-9.0.18/CUSTOMER_TARIFF_REVIEW.md +33 -0
- package/docs/reports/unified-9.0.18/GERAETE_EMS_EINRICHTUNG.md +86 -0
- package/docs/reports/unified-9.0.18/INSTALLER_LIFECYCLE_REVIEW.md +29 -0
- package/docs/reports/unified-9.0.18/KUNDENTARIF_EINRICHTUNG.md +27 -0
- package/docs/reports/unified-9.0.18/PRUEFBERICHT.md +87 -0
- package/docs/reports/unified-9.0.18/UNABHAENGIGER_REVIEW.md +63 -0
- package/docs/reports/unified-9.0.18/raw/INDEX.json +331 -0
- package/docs/reports/unified-9.0.18/raw/audit-full.log +345 -0
- package/docs/reports/unified-9.0.18/raw/audit-full.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/audit-runtime.log +23 -0
- package/docs/reports/unified-9.0.18/raw/audit-runtime.result.json +15 -0
- package/docs/reports/unified-9.0.18/raw/backend-final.log +5 -0
- package/docs/reports/unified-9.0.18/raw/backend-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/frontend-build.log +152 -0
- package/docs/reports/unified-9.0.18/raw/frontend-build.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/installer-build.log +26 -0
- package/docs/reports/unified-9.0.18/raw/installer-build.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/keygen-source.json +6 -0
- package/docs/reports/unified-9.0.18/raw/lint-final.log +5 -0
- package/docs/reports/unified-9.0.18/raw/lint-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/modules-build.log +5 -0
- package/docs/reports/unified-9.0.18/raw/modules-build.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/node22-tests-final.log +9859 -0
- package/docs/reports/unified-9.0.18/raw/node22-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.18/raw/node22-typecheck-final.log +7 -0
- package/docs/reports/unified-9.0.18/raw/node22-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.18/raw/node24-tests-final.log +1663 -0
- package/docs/reports/unified-9.0.18/raw/node24-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.18/raw/node24-typecheck-final.log +5 -0
- package/docs/reports/unified-9.0.18/raw/node24-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.18/raw/sbom-runtime.log +7 -0
- package/docs/reports/unified-9.0.18/raw/sbom-runtime.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/sbom-vendor-check.log +1 -0
- package/docs/reports/unified-9.0.18/raw/sbom-vendor-check.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-docs-check.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-docs-check.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-final.log +7 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-sync.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-sync.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-check.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-check.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-final.log +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-secret-final.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-secret-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-security-final.log +8 -0
- package/docs/reports/unified-9.0.18/raw/ui-security-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/ALIAS_MESSWERTFRISCHE.md +31 -0
- package/docs/reports/unified-9.0.19/COMMISSIONING_PLAN_REVIEW.md +56 -0
- package/docs/reports/unified-9.0.19/EMS_ABSCHLUSSREVIEW.md +43 -0
- package/docs/reports/unified-9.0.19/EMS_KATEGORIEN_ABDECKUNG.md +66 -0
- package/docs/reports/unified-9.0.19/EMS_VERGLEICH_UND_KOPPLUNG.md +25 -0
- package/docs/reports/unified-9.0.19/EVCS_STATE_OBJECTS.md +47 -0
- package/docs/reports/unified-9.0.19/GERAETE_EMS_EINRICHTUNG.md +100 -0
- package/docs/reports/unified-9.0.19/GERAETE_STARTAUSFALL.md +37 -0
- package/docs/reports/unified-9.0.19/INSTALLER_LIFECYCLE_REVIEW.md +59 -0
- package/docs/reports/unified-9.0.19/LEGACY_REGRESSION_REVIEW.md +42 -0
- package/docs/reports/unified-9.0.19/MODBUS_AUTHORIZATION_READS.md +25 -0
- package/docs/reports/unified-9.0.19/PRUEFBERICHT.md +56 -0
- package/docs/reports/unified-9.0.19/RUNTIME_START_UEBERNAHME.md +33 -0
- package/docs/reports/unified-9.0.19/SMA_RECEIVER_LIFECYCLE.md +42 -0
- package/docs/reports/unified-9.0.19/STATIC_REVIEW_DE.md +11 -0
- package/docs/reports/unified-9.0.19/TARIFF_PRICE_VALUES_REVIEW.md +31 -0
- package/docs/reports/unified-9.0.19/TARIF_VIERTELSTUNDEN_RUNTIME.md +17 -0
- package/docs/reports/unified-9.0.19/UNABHAENGIGER_REVIEW.md +49 -0
- package/docs/reports/unified-9.0.19/raw/INDEX.json +751 -0
- package/docs/reports/unified-9.0.19/raw/audit-full.log +345 -0
- package/docs/reports/unified-9.0.19/raw/audit-full.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/audit-runtime.log +23 -0
- package/docs/reports/unified-9.0.19/raw/audit-runtime.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/backend-final.log +5 -0
- package/docs/reports/unified-9.0.19/raw/backend-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.log +0 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.log +0 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-build.log +5 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-host-final.log +70 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-lease-918-before.log +26 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-lease-after.log +9 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-after.log +11 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-before.log +28 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-web-pipeline.log +22 -0
- package/docs/reports/unified-9.0.19/raw/frontend-build.log +152 -0
- package/docs/reports/unified-9.0.19/raw/frontend-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/installer-build.log +26 -0
- package/docs/reports/unified-9.0.19/raw/installer-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/keygen-source.json +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.log +539 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-history-http.log +39 -0
- package/docs/reports/unified-9.0.19/raw/legacy-history-http.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.log +30 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.log +203 -0
- package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.log +18 -0
- package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.log +16 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-test-loader.cjs +47 -0
- package/docs/reports/unified-9.0.19/raw/lint-final.log +16 -0
- package/docs/reports/unified-9.0.19/raw/lint-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/modules-build.log +5 -0
- package/docs/reports/unified-9.0.19/raw/modules-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node22-tests-final.log +10719 -0
- package/docs/reports/unified-9.0.19/raw/node22-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.log +7 -0
- package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.19/raw/node24-tests-final.log +1805 -0
- package/docs/reports/unified-9.0.19/raw/node24-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.log +5 -0
- package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.19/raw/sbom-runtime.log +7 -0
- package/docs/reports/unified-9.0.19/raw/sbom-runtime.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.log +1 -0
- package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.log +11 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.log +68 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-docs-check.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-docs-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-final.log +7 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-check.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-secret-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-secret-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-security-final.log +8 -0
- package/docs/reports/unified-9.0.19/raw/ui-security-final.result.json +14 -0
- package/io-package.json +12 -12
- package/modules/devices/admin/alias-contract-v1.json +189 -0
- package/modules/devices/admin/ems-assignment.d.ts +16 -0
- package/modules/devices/admin/ems-assignment.js +356 -0
- package/modules/devices/admin/host-bridge.js +76 -4
- package/modules/devices/admin/index.html +40 -1
- package/modules/devices/admin/index_m.js +158 -2
- package/modules/devices/admin/style.css +32 -4
- package/modules/devices/checks/emsAssignment.check.js +132 -0
- package/modules/devices/contracts.d.ts +1 -1
- package/modules/devices/eslint.hosted.config.mjs +1 -1
- package/modules/devices/index.js +64 -16
- package/modules/devices/lib/alias-contract-v1.json +189 -0
- package/modules/devices/lib/aliasContract.js +7 -1
- package/modules/devices/lib/device-alias-semantics-v1.json +1605 -0
- package/modules/devices/lib/deviceAliasFreshness.js +65 -0
- package/modules/devices/lib/deviceAliasSemantics.js +109 -0
- package/modules/devices/lib/deviceRuntime.js +204 -127
- package/modules/devices/lib/drivers/modbus.js +18 -3
- package/modules/devices/lib/drivers/speedwire.js +42 -22
- package/modules/devices/test/aliasContractV1.test.js +1 -1
- package/modules/devices/test/deviceAliasFreshness.test.js +149 -0
- package/modules/devices/test/deviceAliasSemantics.test.js +163 -0
- package/modules/devices/test/emsAssignmentUi.test.js +298 -0
- package/modules/devices/test/modbusAuthorizationReads.test.js +112 -0
- package/modules/devices/test/runtimeLiveness.test.js +1 -1
- package/modules/devices/test/speedwireLifecycle.test.js +118 -0
- package/modules/devices/tsconfig.alias-semantics.json +17 -0
- package/modules/devices/tsconfig.ems-ui.json +9 -0
- package/modules/devices/tsconfig.hosted.json +1 -1
- package/package.json +11 -7
- package/release-manifests/unified/build-environment.cdx.json +1483 -7370
- package/release-manifests/unified/files.json +392 -121
- package/release-manifests/unified/frontend.cdx.json +2688 -5952
- package/release-manifests/unified/installer.cdx.json +2053 -821
- package/release-manifests/unified/obsolete-admin-assets.json +172 -6
- package/release-manifests/unified/runtime.cdx.json +40 -3283
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-check.cjs +1 -1
- package/tools/eos-release-manifest.cjs +5 -5
- package/ui/docs/security/eslint-reviewed-findings.json +32 -18
- package/ui/ems/datapoints.js +22 -1
- package/ui/ems/engine.js +54 -7
- package/ui/ems/module-manager.js +44 -21
- package/ui/ems/modules/core-limits.js +5 -3
- package/ui/ems/modules/energy-wallet.js +31 -32
- package/ui/ems/modules/storage-control.js +5 -4
- package/ui/ems/modules/tarif-vis.js +36 -24
- package/ui/ems/modules/tariff-provider.js +259 -59
- package/ui/ems/services/tariff-provider-registry.js +11 -8
- package/ui/io-package.json +5 -1
- package/ui/lib/customer-tariff.js +245 -0
- package/ui/lib/installer-lifecycle.js +220 -0
- package/ui/lib/storage-farm-overview.js +115 -0
- package/ui/lib/tariff-price.js +115 -0
- package/ui/main.js +400 -163
- package/ui/package.json +14 -4
- package/ui/www/app.js +47 -134
- package/ui/www/customer-tariff.css +21 -0
- package/ui/www/customer-tariff.js +333 -0
- package/ui/www/ems-apps.html +2 -0
- package/ui/www/ems-apps.js +29 -7
- package/ui/www/index.html +2 -0
- package/ui/www/licenses/smarthome-markdown-components.json +156 -156
- package/ui/www/manifest.webmanifest +2 -2
- package/ui/www/power-measurements.js +62 -0
- package/ui/www/settings.html +47 -0
- package/ui/www/storagefarm-summary.css +17 -0
- package/ui/www/storagefarm-summary.js +136 -0
- package/ui/www/storagefarm.html +16 -1
- package/ui/www/storagefarm.js +10 -22
- package/ui/www/tariff-display.js +161 -0
|
@@ -13,6 +13,7 @@ let manufacturersByCategory = {}; // cat -> [manu]
|
|
|
13
13
|
let templatesByCatManu = {}; // cat -> manu -> [template]
|
|
14
14
|
let devices = [];
|
|
15
15
|
let editIndex = -1;
|
|
16
|
+
let emsRenewalRequested = false;
|
|
16
17
|
let onChangeGlobal = null;
|
|
17
18
|
let uiInitialized = false;
|
|
18
19
|
let lastSuggestedId = '';
|
|
@@ -824,6 +825,126 @@ function summarizeConnection(d) {
|
|
|
824
825
|
return '';
|
|
825
826
|
}
|
|
826
827
|
|
|
828
|
+
function emsPresentation(device) {
|
|
829
|
+
return window.EosDeviceEms.describe(device.id, device.ems, device.enabled);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
function updateEmsControls(settings) {
|
|
833
|
+
const api = window.EosDeviceEms;
|
|
834
|
+
const current = settings || {
|
|
835
|
+
mode: document.getElementById('dev_ems_mode').value,
|
|
836
|
+
scope: document.getElementById('dev_ems_scope').value,
|
|
837
|
+
flowSlot: Number(document.getElementById('dev_ems_slot').value)
|
|
838
|
+
};
|
|
839
|
+
const desired = api.intent(current);
|
|
840
|
+
const select = document.getElementById('dev_ems_mode');
|
|
841
|
+
const choices = api.modes($('#dev_category').val());
|
|
842
|
+
select.replaceChildren();
|
|
843
|
+
for (const choice of choices) {
|
|
844
|
+
const option = document.createElement('option');
|
|
845
|
+
option.value = choice.value; option.textContent = choice.label;
|
|
846
|
+
select.appendChild(option);
|
|
847
|
+
}
|
|
848
|
+
select.value = choices.some(choice => choice.value === desired.mode) ? desired.mode : 'auto';
|
|
849
|
+
document.getElementById('dev_ems_scope').value = desired.scope || '';
|
|
850
|
+
if (settings) {
|
|
851
|
+
document.getElementById('dev_ems_requested').checked = desired.activation?.requested !== false;
|
|
852
|
+
const limits = desired.activation?.limits || {};
|
|
853
|
+
for (const key of ['coupling', 'maxChargeW', 'maxDischargeW', 'capacityKWh', 'chargerType', 'phases', 'minCurrentA', 'maxCurrentA', 'minPowerW', 'maxPowerW']) {
|
|
854
|
+
const control = document.getElementById('dev_ems_' + key);
|
|
855
|
+
control.value = Object.hasOwn(limits, key) ? String(Reflect.get(limits, key)) : '';
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
updateEmsTargets(settings ? (desired.flowSlot ?? '') : undefined);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
function updateEmsTargets(savedSlot) {
|
|
862
|
+
const mode = document.getElementById('dev_ems_mode').value;
|
|
863
|
+
const scope = document.getElementById('dev_ems_scope').value;
|
|
864
|
+
const field = document.getElementById('dev_ems_slot_field');
|
|
865
|
+
const select = document.getElementById('dev_ems_slot');
|
|
866
|
+
const previous = savedSlot === '' ? '' : typeof savedSlot === 'number' ? String(savedSlot) : select.value;
|
|
867
|
+
const targets = window.EosDeviceEms.targets(mode);
|
|
868
|
+
select.replaceChildren();
|
|
869
|
+
const placeholder = document.createElement('option');
|
|
870
|
+
placeholder.value = ''; placeholder.textContent = 'Bitte auswählen'; select.appendChild(placeholder);
|
|
871
|
+
for (const target of targets) {
|
|
872
|
+
const option = document.createElement('option'); option.value = String(target.value); option.textContent = target.label; select.appendChild(option);
|
|
873
|
+
}
|
|
874
|
+
select.value = targets.some(target => String(target.value) === previous) ? previous : '';
|
|
875
|
+
field.hidden = targets.length === 0;
|
|
876
|
+
document.getElementById('dev_ems_scope_field').hidden = !['singleStorage', 'storageFarm', 'gridMeter'].includes(mode);
|
|
877
|
+
document.getElementById('dev_ems_help').textContent = window.EosDeviceEms.help(String($('#dev_category').val() || ''), mode, scope);
|
|
878
|
+
updateEmsActivation();
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
function updateEmsActivation() {
|
|
882
|
+
const mode = document.getElementById('dev_ems_mode').value;
|
|
883
|
+
const category = String($('#dev_category').val() || '').toUpperCase();
|
|
884
|
+
const storage = ['singleStorage', 'storageFarm'].includes(mode);
|
|
885
|
+
const charger = mode === 'auto' && ['EVCS', 'EVSE'].includes(category);
|
|
886
|
+
const applicable = storage || charger || ['gridMeter', 'generationMeter', 'consumptionMeter', 'pvInverter'].includes(mode);
|
|
887
|
+
document.getElementById('dev_ems_activation_field').hidden = !applicable;
|
|
888
|
+
const requested = document.getElementById('dev_ems_requested').checked;
|
|
889
|
+
const type = document.getElementById('dev_ems_chargerType').value;
|
|
890
|
+
for (const field of document.querySelectorAll('[data-ems-limit]')) {
|
|
891
|
+
const group = field.dataset.emsLimit;
|
|
892
|
+
field.hidden = !requested || !(group === 'storage' && storage || group === 'charger' && charger || group === type && charger);
|
|
893
|
+
}
|
|
894
|
+
document.getElementById('dev_ems_limits_help').hidden = !requested || !(storage || charger);
|
|
895
|
+
document.getElementById('dev_ems_limits_title').hidden = !requested || !(storage || charger);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
function collectEmsActivation(value, previous) {
|
|
899
|
+
if (document.getElementById('dev_ems_activation_field').hidden) return;
|
|
900
|
+
const requested = document.getElementById('dev_ems_requested').checked;
|
|
901
|
+
const limits = { ...(previous?.activation?.limits || {}) };
|
|
902
|
+
const storage = ['singleStorage', 'storageFarm'].includes(value.mode);
|
|
903
|
+
const charger = value.mode === 'auto';
|
|
904
|
+
const kind = document.getElementById('dev_ems_chargerType').value;
|
|
905
|
+
const fields = storage ? ['coupling', 'maxChargeW', 'maxDischargeW', 'capacityKWh']
|
|
906
|
+
: charger ? ['chargerType', ...(kind === 'dc' ? ['minPowerW', 'maxPowerW'] : ['phases', 'minCurrentA', 'maxCurrentA'])] : [];
|
|
907
|
+
for (const key of fields) {
|
|
908
|
+
const raw = document.getElementById('dev_ems_' + key).value.trim();
|
|
909
|
+
if (!raw) continue; // Existing App-Center limits are resolved on the server.
|
|
910
|
+
if (['coupling', 'chargerType'].includes(key)) {
|
|
911
|
+
if (!['ac', 'dc'].includes(raw)) throw new Error('Bitte eine gültige Anbindung auswählen.');
|
|
912
|
+
Reflect.set(limits, key, raw);
|
|
913
|
+
} else {
|
|
914
|
+
const numeric = Number(raw);
|
|
915
|
+
if (!Number.isFinite(numeric) || numeric <= 0 || numeric > 10000000 || key === 'phases' && ![1, 3].includes(numeric)) throw new Error('Bitte positive, gültige EMS-Grenzen eingeben.');
|
|
916
|
+
Reflect.set(limits, key, numeric);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
if (requested && limits.minCurrentA > limits.maxCurrentA || requested && limits.minPowerW > limits.maxPowerW) throw new Error('Die minimale Ladegrenze darf die maximale Grenze nicht überschreiten.');
|
|
920
|
+
if (requested && editIndex < 0 && storage && (!limits.maxChargeW || !limits.maxDischargeW)) throw new Error('Für den neuen Speicher maximale Lade- und Entladeleistung angeben.');
|
|
921
|
+
if (requested && editIndex < 0 && charger && (!limits.chargerType || kind === 'ac' && (!limits.phases || !limits.minCurrentA || !limits.maxCurrentA) || kind === 'dc' && (!limits.minPowerW || !limits.maxPowerW))) throw new Error('Für den neuen Ladepunkt Ladeart und zugehörige Grenzen angeben.');
|
|
922
|
+
value.activation = { requested, limits };
|
|
923
|
+
if (previous?.activation?.requestId) value.activation.requestId = previous.activation.requestId;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
function collectEmsIntent() {
|
|
927
|
+
const mode = document.getElementById('dev_ems_mode').value;
|
|
928
|
+
if (!window.EosDeviceEms.modes($('#dev_category').val()).some(choice => choice.value === mode)) throw new Error('EMS-Funktion passt nicht zur Gerätekategorie');
|
|
929
|
+
const value = { mode };
|
|
930
|
+
const previous = editIndex >= 0 ? devices[editIndex].ems : null;
|
|
931
|
+
if (previous && typeof previous.group === 'string') value.group = previous.group;
|
|
932
|
+
if (['singleStorage', 'storageFarm', 'gridMeter'].includes(mode)) {
|
|
933
|
+
const scope = document.getElementById('dev_ems_scope').value;
|
|
934
|
+
if (!['M0', 'M1'].includes(scope)) throw new Error('Regelbereich / Messpunkt für die EMS-Zuordnung auswählen');
|
|
935
|
+
value.scope = scope;
|
|
936
|
+
}
|
|
937
|
+
const targets = window.EosDeviceEms.targets(mode);
|
|
938
|
+
if (targets.length) {
|
|
939
|
+
const slot = document.getElementById('dev_ems_slot').value;
|
|
940
|
+
const chosen = targets.find(target => String(target.value) === slot);
|
|
941
|
+
if (!chosen) throw new Error('Ziel für die Zuordnung im Energiefluss auswählen');
|
|
942
|
+
value.flowSlot = chosen.value;
|
|
943
|
+
}
|
|
944
|
+
collectEmsActivation(value, previous);
|
|
945
|
+
return value;
|
|
946
|
+
}
|
|
947
|
+
|
|
827
948
|
function renderDevicesTable() {
|
|
828
949
|
const tbody = $('#devicesTable tbody');
|
|
829
950
|
tbody.empty();
|
|
@@ -839,15 +960,18 @@ function renderDevicesTable() {
|
|
|
839
960
|
const manufacturer = tpl ? (tpl.manufacturer || '') : '';
|
|
840
961
|
const tplName = tpl ? (tpl.name || tpl.id) : (d.templateId || '');
|
|
841
962
|
|
|
963
|
+
const ems = emsPresentation(d);
|
|
964
|
+
const capabilities = window.EosDeviceEms.capabilities(tpl);
|
|
842
965
|
const row = $(`
|
|
843
966
|
<tr>
|
|
844
967
|
<td>${d.enabled ? '✓' : ''}</td>
|
|
845
968
|
<td><code>${escapeHtml(d.id)}</code></td>
|
|
846
|
-
<td>${escapeHtml(d.name || '')}</td>
|
|
969
|
+
<td>${escapeHtml(d.name || '')}${capabilities.length ? `<details class="nexo-ems-notes"><summary>Profilfunktionen</summary><div class="nexo-capability-chips">${capabilities.map(item => `<span>${escapeHtml(item)}</span>`).join('')}</div><p>Profilangaben · Betriebsfreigabe siehe EMS-Status.</p></details>` : ''}</td>
|
|
847
970
|
<td>${escapeHtml(d.category || '')}</td>
|
|
848
971
|
<td>${escapeHtml(manufacturer)}</td>
|
|
849
972
|
<td>${escapeHtml(tplName)}</td>
|
|
850
973
|
<td>${escapeHtml(d.protocol || '')}</td>
|
|
974
|
+
<td class="nexo-ems-cell"><span data-eos-ems-id="${escapeHtml(d.id)}" data-eos-ems-mode="${escapeHtml(window.EosDeviceEms.intent(d.ems).mode)}" data-eos-ems-enabled="${d.enabled !== false}" data-state="${escapeHtml(ems.status)}">${escapeHtml(ems.label)} · ${escapeHtml(ems.detail)}</span><details class="nexo-ems-notes"${ems.optionalDetail ? '' : ' hidden'}><summary>Profilhinweise</summary><p>${escapeHtml(ems.optionalDetail || '')}</p></details></td>
|
|
851
975
|
<td class="actions">
|
|
852
976
|
<a href="#!" class="btn-small waves-effect" data-action="edit" data-idx="${idx}">${escapeHtml('Gerät bearbeiten')}</a>
|
|
853
977
|
<a href="#!" class="btn-small red waves-effect" data-action="delete" data-idx="${idx}">${escapeHtml('Löschen')}</a>
|
|
@@ -1054,8 +1178,27 @@ function collectFeneconControllerOffset() {
|
|
|
1054
1178
|
return offset;
|
|
1055
1179
|
}
|
|
1056
1180
|
|
|
1181
|
+
function renderProfileCapabilities(template) {
|
|
1182
|
+
const container = document.getElementById('dev_profile_capabilities');
|
|
1183
|
+
container.replaceChildren();
|
|
1184
|
+
const title = document.createElement('p');
|
|
1185
|
+
title.textContent = 'Im Geräteprofil vorgesehen';
|
|
1186
|
+
title.className = 'nexo-muted'; container.appendChild(title);
|
|
1187
|
+
const capabilities = window.EosDeviceEms.capabilities(template);
|
|
1188
|
+
const list = document.createElement('div'); list.className = 'nexo-capability-chips';
|
|
1189
|
+
for (const capability of capabilities) {
|
|
1190
|
+
const chip = document.createElement('span'); chip.textContent = capability; list.appendChild(chip);
|
|
1191
|
+
}
|
|
1192
|
+
if (!capabilities.length) list.textContent = 'Keine eindeutigen Funktionsangaben im geladenen Profil.';
|
|
1193
|
+
container.appendChild(list);
|
|
1194
|
+
const hint = document.createElement('p'); hint.className = 'nexo-muted nexo-capability-hint';
|
|
1195
|
+
hint.textContent = 'Die tatsächliche EMS-Verwendbarkeit wird anhand der Alias-Datenpunkte geprüft und im Gerätestatus angezeigt.';
|
|
1196
|
+
container.appendChild(hint);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1057
1199
|
function renderDatapoints(templateId) {
|
|
1058
1200
|
const tpl = templatesById[templateId];
|
|
1201
|
+
renderProfileCapabilities(tpl);
|
|
1059
1202
|
renderVartaOptions(tpl);
|
|
1060
1203
|
renderDeyeOptions(tpl);
|
|
1061
1204
|
renderFeneconOptions(tpl);
|
|
@@ -1084,6 +1227,7 @@ function renderDatapoints(templateId) {
|
|
|
1084
1227
|
}
|
|
1085
1228
|
|
|
1086
1229
|
function openDeviceModal(device, idx) {
|
|
1230
|
+
emsRenewalRequested = false;
|
|
1087
1231
|
editIndex = (typeof idx === 'number') ? idx : -1;
|
|
1088
1232
|
$('#modalTitle').text(editIndex >= 0 ? 'Gerät bearbeiten' : 'Gerät hinzufügen');
|
|
1089
1233
|
|
|
@@ -1097,6 +1241,7 @@ function openDeviceModal(device, idx) {
|
|
|
1097
1241
|
const cat = device.category || categories[0] || 'GENERIC';
|
|
1098
1242
|
$('#dev_category').val(cat);
|
|
1099
1243
|
refreshSelect($('#dev_category'));
|
|
1244
|
+
updateEmsControls(device.ems || {});
|
|
1100
1245
|
|
|
1101
1246
|
fillManufacturerSelect(cat);
|
|
1102
1247
|
const manuList = manufacturersByCategory[cat] || [];
|
|
@@ -1161,6 +1306,7 @@ function openDeviceModal(device, idx) {
|
|
|
1161
1306
|
refreshSelect($('#mb_wordOrder'));
|
|
1162
1307
|
refreshSelect($('#mb_byteOrder'));
|
|
1163
1308
|
applyTemplateModbusTcpDefaultsToForm(tpl, proto, c);
|
|
1309
|
+
renderProfileCapabilities(tpl);
|
|
1164
1310
|
renderVartaOptions(tpl);
|
|
1165
1311
|
$('#varta_allow_sf_writes').prop('checked', device.vartaAllowScaleFactorWrites === true && !!(tpl && tpl.driverHints && tpl.driverHints.vartaModbus && ['pulseNeo', 'flexStorage'].includes(tpl.driverHints.vartaModbus.product)));
|
|
1166
1312
|
$('#varta_extended_enabled').prop('checked', device.vartaExtendedEnabled !== false);
|
|
@@ -1314,7 +1460,8 @@ function collectDeviceFromModal() {
|
|
|
1314
1460
|
protocol: $('#dev_protocol').val(),
|
|
1315
1461
|
pollIntervalMs: ($('#dev_poll').val() || '').trim() ? parseInt($('#dev_poll').val(), 10) : undefined,
|
|
1316
1462
|
heartbeatTimeoutMs: ($('#dev_hbTimeout').val() || '').trim() ? parseInt($('#dev_hbTimeout').val(), 10) : undefined,
|
|
1317
|
-
connection: {}
|
|
1463
|
+
connection: {},
|
|
1464
|
+
ems: collectEmsIntent()
|
|
1318
1465
|
};
|
|
1319
1466
|
|
|
1320
1467
|
if (tpl && tpl.driverHints && tpl.driverHints.vartaModbus) {
|
|
@@ -1558,6 +1705,13 @@ function updateJsonPreview() {
|
|
|
1558
1705
|
}
|
|
1559
1706
|
|
|
1560
1707
|
function initEventHandlers() {
|
|
1708
|
+
$('#dev_ems_mode').on('change', () => { document.getElementById('dev_ems_requested').checked = true; updateEmsTargets(); });
|
|
1709
|
+
$('#dev_ems_requested').on('change', () => {
|
|
1710
|
+
if (document.getElementById('dev_ems_requested').checked && editIndex >= 0) emsRenewalRequested = true;
|
|
1711
|
+
updateEmsActivation();
|
|
1712
|
+
});
|
|
1713
|
+
$('#dev_ems_chargerType').on('change', updateEmsActivation);
|
|
1714
|
+
$('#dev_ems_scope').on('change', () => updateEmsTargets());
|
|
1561
1715
|
$('#fenecon_ctrl_profile').on('change', function () {
|
|
1562
1716
|
const profile = $('#fenecon_ctrl_profile').val();
|
|
1563
1717
|
$('#fenecon_ctrl_custom').toggle(profile === 'custom');
|
|
@@ -1678,6 +1832,7 @@ function initEventHandlers() {
|
|
|
1678
1832
|
|
|
1679
1833
|
// Modal dependent selects
|
|
1680
1834
|
$('#dev_category').on('change', () => {
|
|
1835
|
+
updateEmsControls();
|
|
1681
1836
|
const cat = $('#dev_category').val();
|
|
1682
1837
|
fillManufacturerSelect(cat);
|
|
1683
1838
|
|
|
@@ -1823,6 +1978,7 @@ function initEventHandlers() {
|
|
|
1823
1978
|
devices.push(d);
|
|
1824
1979
|
}
|
|
1825
1980
|
|
|
1981
|
+
if (emsRenewalRequested) window.EosDeviceEms.requestRenewal(d.id);
|
|
1826
1982
|
devices.sort((a, b) => (a.id || '').localeCompare(b.id || ''));
|
|
1827
1983
|
|
|
1828
1984
|
renderDevicesTable();
|
|
@@ -513,8 +513,8 @@ code {
|
|
|
513
513
|
.eos-host-links { margin-bottom: 12px; }
|
|
514
514
|
.eos-host-actions label { color: #e6edf3; padding-right: 12px; }
|
|
515
515
|
.eos-host-actions .btn-flat { color: #bce9dc; border: 1px solid #45685f; }
|
|
516
|
-
#eosModuleStatus { margin: 10px 0 0; }
|
|
517
|
-
#eosModuleStatus[data-error="true"] { color: #ffaaa1; }
|
|
516
|
+
#eosModuleStatus, #eosModuleRuntimeStatus { margin: 10px 0 0; }
|
|
517
|
+
#eosModuleStatus[data-error="true"], #eosModuleRuntimeStatus[data-error="true"] { color: #ffaaa1; }
|
|
518
518
|
.eos-host-import { margin-top: 12px; }
|
|
519
519
|
.eos-host-import summary { cursor: pointer; color: #a3d5c6; }
|
|
520
520
|
.eos-host-import input { max-width: 280px; }
|
|
@@ -556,8 +556,8 @@ body.eos-module-page {
|
|
|
556
556
|
.m .eos-host-actions input[type="checkbox"] { appearance: auto; -webkit-appearance: checkbox; opacity: 1; pointer-events: auto; position: static; width: 20px; height: 20px; margin: 0; }
|
|
557
557
|
.m .eos-host-actions input[type="checkbox"] + span { padding-left: 0; line-height: 1.5; height: auto; }
|
|
558
558
|
.m .eos-host-actions input[type="checkbox"] + span::before, .m .eos-host-actions input[type="checkbox"] + span::after { display: none; }
|
|
559
|
-
.m #eosModuleStatus { margin: 14px 0 0; color: #b7d9cd; font-size: 14px; }
|
|
560
|
-
.m #eosModuleStatus[data-error="true"] { color: #ffadb8; }
|
|
559
|
+
.m #eosModuleStatus, .m #eosModuleRuntimeStatus { margin: 14px 0 0; color: #b7d9cd; font-size: 14px; }
|
|
560
|
+
.m #eosModuleStatus[data-error="true"], .m #eosModuleRuntimeStatus[data-error="true"] { color: #ffadb8; }
|
|
561
561
|
.m #eosModuleStatus a { display: inline-block; margin-left: 8px; text-decoration: underline; color: #baffdf; }
|
|
562
562
|
.m .eos-host-import { border-top: 1px solid var(--eos-border); margin-top: 16px; padding-top: 14px; }
|
|
563
563
|
.m .eos-host-import p { color: var(--eos-muted); font-size: 14px; max-width: 1000px; }
|
|
@@ -647,3 +647,31 @@ body.eos-module-page {
|
|
|
647
647
|
.m .nexo-modal .modal-footer { padding: 12px 16px; }
|
|
648
648
|
.m .nexo-modal .card-panel { padding: 16px; }
|
|
649
649
|
}
|
|
650
|
+
|
|
651
|
+
/* Device→EMS commissioning: native selects, bounded responsive layout. */
|
|
652
|
+
.nexo-ems-config, .nexo-ems-summary { border: 1px solid var(--nexo-border-strong); border-radius: 12px; padding: 16px; margin: 16px 0; background: rgba(0, 190, 145, .045); }
|
|
653
|
+
.nexo-ems-config h6 { font-size: 1.05rem; font-weight: 700; margin: 0 0 16px; }
|
|
654
|
+
.nexo-ems-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
|
|
655
|
+
.nexo-ems-fields > div { min-width: 0; }
|
|
656
|
+
.nexo-ems-fields label { display: block; margin-bottom: 8px; color: var(--nexo-text); }
|
|
657
|
+
.nexo-ems-fields select { width: 100%; max-width: 100%; }
|
|
658
|
+
.nexo-ems-fields [hidden] { display: none !important; }
|
|
659
|
+
.nexo-ems-links { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
|
|
660
|
+
.nexo-ems-links a { text-decoration: underline; text-underline-offset: 3px; }
|
|
661
|
+
.nexo-ems-cell { min-width: 190px; max-width: 290px; font-size: .85rem; white-space: normal; overflow-wrap: anywhere; }
|
|
662
|
+
.nexo-ems-cell [data-state="mapped"], #eosEmsStatus[data-state="mapped"] { color: #6fe4bc; }
|
|
663
|
+
.nexo-ems-cell [data-state="conflict"], #eosEmsStatus[data-state="conflict"] { color: #ffb0a5; }
|
|
664
|
+
.nexo-ems-cell [data-state="pending"] { color: #f0d594; }
|
|
665
|
+
|
|
666
|
+
.nexo-ems-config [hidden] { display: none !important; }
|
|
667
|
+
.nexo-ems-check { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; }
|
|
668
|
+
.nexo-ems-fields input { box-sizing: border-box; width: 100%; }
|
|
669
|
+
.nexo-ems-step { font-size: .8rem; color: #65dfba; letter-spacing: .04em; font-weight: 700; margin: 20px 0 12px; }
|
|
670
|
+
.nexo-ems-notes { margin-top: 8px; color: #b0c5d1; }
|
|
671
|
+
.nexo-ems-notes[hidden] { display: none; }
|
|
672
|
+
.nexo-ems-notes summary { cursor: pointer; font-size: .8rem; }
|
|
673
|
+
|
|
674
|
+
.nexo-profile-capabilities { border-bottom: 1px solid var(--eos-border); padding-bottom: 12px; }
|
|
675
|
+
.nexo-capability-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
676
|
+
.nexo-capability-chips span { border: 1px solid #24585c; border-radius: 999px; padding: 4px 9px; color: #a7ead9; background: #0a2b31; font-size: .77rem; }
|
|
677
|
+
.nexo-capability-hint { font-size: .8rem; margin-bottom: 0; }
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* Copyright (c) 2026 NexoWatt. Confidential and proprietary. */
|
|
2
|
+
'use strict';
|
|
3
|
+
// Actual Chromium UI against a local authenticated-contract fixture. No hardware,
|
|
4
|
+
// license bypass or assertion of controller integration is made by this test.
|
|
5
|
+
const test = require('node:test');
|
|
6
|
+
const assert = require('node:assert/strict');
|
|
7
|
+
const http = require('node:http');
|
|
8
|
+
const fs = require('node:fs/promises');
|
|
9
|
+
const path = require('node:path');
|
|
10
|
+
const os = require('node:os');
|
|
11
|
+
const puppeteer = require('puppeteer');
|
|
12
|
+
const { validateConfig } = require('..');
|
|
13
|
+
const root = path.resolve(__dirname, '../../..');
|
|
14
|
+
const screenshots = process.env.EOS_BROWSER_OUTPUT;
|
|
15
|
+
|
|
16
|
+
test('Devices EMS form: wallbox default, meter/PV targets, storage choice, durable roundtrip and responsive status', async t => {
|
|
17
|
+
const errors = []; const received = [];
|
|
18
|
+
let ready = false; let reads = 0;
|
|
19
|
+
const basic = (id, category, templateId, manufacturer) => ({ id, category, templateId, manufacturer, name: id,
|
|
20
|
+
enabled: true, protocol: 'modbusTcp', connection: { host: '192.0.2.20', port: 502, unitId: 1, password: '__EOS_SECRET_UNCHANGED__', customRetained: 9 }, futureSetting: 'keep' });
|
|
21
|
+
let config = { enabled: true, devices: [
|
|
22
|
+
basic('evcs1', 'EVCS', 'evcs.abl.EvcsAblImpl', 'ABL'),
|
|
23
|
+
basic('meter1', 'METER', 'meter.artemes.MeterArtemesAM2Impl', 'Artemes'),
|
|
24
|
+
basic('storage1', 'ESS', 'ess.adstec.EssAdstecStoraxeImpl', 'ADS-TEC'),
|
|
25
|
+
basic('pv1', 'PV_INVERTER', 'pv_inverter.foxess.FoxESSTG3G3PvInverter', 'FoxESS'),
|
|
26
|
+
], futureModuleSetting: { retain: true } };
|
|
27
|
+
const assets = {
|
|
28
|
+
'/modules/devices/': 'modules/devices/admin/index.html',
|
|
29
|
+
'/modules/devices/vendor/jquery.js': 'adminWww/lib/js/jquery-3.2.1.min.js',
|
|
30
|
+
'/modules/devices/vendor/materialize.js': 'adminWww/lib/js/materialize.js',
|
|
31
|
+
'/modules/devices/vendor/materialize.css': 'adminWww/lib/css/materialize.css',
|
|
32
|
+
'/modules/devices/vendor/adapter.css': 'adminWww/css/adapter.css',
|
|
33
|
+
'/modules/devices/templates.json': 'modules/devices/lib/templates.json',
|
|
34
|
+
'/modules/shared/eos-module.css': 'modules/shared/eos-module.css',
|
|
35
|
+
'/system/img/eos/nexowatt-eos-brand-wide.png': 'adminWww/img/eos/nexowatt-eos-brand-wide.png',
|
|
36
|
+
};
|
|
37
|
+
for (const file of ['host-bridge.js', 'ems-assignment.js', 'index_m.js', 'style.css', 'words.js']) assets[`/modules/devices/${file}`] = `modules/devices/admin/${file}`;
|
|
38
|
+
const server = http.createServer(async (req, res) => {
|
|
39
|
+
try {
|
|
40
|
+
const url = new URL(req.url, 'http://localhost');
|
|
41
|
+
if (url.pathname.startsWith('/api/eos/modules/devices')) {
|
|
42
|
+
res.setHeader('Content-Type', 'application/json');
|
|
43
|
+
if (req.method !== 'GET') {
|
|
44
|
+
assert.equal(req.headers['x-nw-csrf'], 'fixture-csrf');
|
|
45
|
+
let body = ''; for await (const chunk of req) body += chunk;
|
|
46
|
+
const input = JSON.parse(body); received.push({ method: req.method, input });
|
|
47
|
+
if (req.method === 'PUT') { config = validateConfig(input.config); ready = true; }
|
|
48
|
+
} else reads++;
|
|
49
|
+
if (url.pathname.endsWith('/command')) { res.end(JSON.stringify({ result: [] })); return; }
|
|
50
|
+
res.end(JSON.stringify({ config, csrfToken: 'fixture-csrf', configurationReady: true,
|
|
51
|
+
status: { active: true, reason: 'RUNNING' }, emsCommissioning: { state: ready ? 'ready' : 'pending',
|
|
52
|
+
statuses: config.devices.map(d => ({ deviceId: d.id, status: ready ? 'mapped' : 'pending', code: ready ? 'ACTIVATION_APPLIED' : 'ALIASES_PENDING', activationApplied: ready, activationRequestId: d.ems?.activation?.requestId })) } })); return;
|
|
53
|
+
}
|
|
54
|
+
if (url.pathname === '/eos-session-idle.js') { res.setHeader('Content-Type', 'text/javascript'); res.end('/* idle lifecycle separately tested */'); return; }
|
|
55
|
+
const asset = assets[url.pathname];
|
|
56
|
+
if (!asset) { res.writeHead(404).end(); return; }
|
|
57
|
+
res.setHeader('Content-Type', ({ '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.json': 'application/json', '.png': 'image/png' })[path.extname(asset)]);
|
|
58
|
+
res.end(await fs.readFile(path.join(root, asset)));
|
|
59
|
+
} catch (error) { errors.push(String(error)); res.writeHead(500).end(); }
|
|
60
|
+
});
|
|
61
|
+
server.listen(0, '127.0.0.1'); await new Promise(resolve => server.once('listening', resolve));
|
|
62
|
+
t.after(() => { server.closeAllConnections(); return new Promise(resolve => server.close(resolve)); });
|
|
63
|
+
const userDataDir = await fs.mkdtemp(path.join(os.tmpdir(), 'eos-devices-ui-'));
|
|
64
|
+
t.after(() => fs.rm(userDataDir, { recursive: true, force: true }));
|
|
65
|
+
const browser = await puppeteer.launch({ executablePath: process.env.CHROMIUM_PATH || '/usr/bin/chromium', userDataDir, headless: true, args: ['--no-sandbox', '--disable-dev-shm-usage'] });
|
|
66
|
+
t.after(() => browser.close());
|
|
67
|
+
const page = await browser.newPage(); page.on('pageerror', error => errors.push(error.message));
|
|
68
|
+
await page.setViewport({ width: 1440, height: 1050 });
|
|
69
|
+
await page.goto(`http://127.0.0.1:${server.address().port}/modules/devices/`);
|
|
70
|
+
await page.waitForFunction(() => !document.getElementById('eosDeviceEditor').inert && Number(document.getElementById('tplCount').textContent) > 100);
|
|
71
|
+
await page.click('a[href="#tabDevices"]');
|
|
72
|
+
async function edit(id) {
|
|
73
|
+
await page.evaluate(deviceId => {
|
|
74
|
+
const row = Array.from(document.querySelectorAll('#devicesTable tbody tr')).find(row => row.querySelector('code')?.textContent === deviceId);
|
|
75
|
+
row.querySelector('[data-action="edit"]').click();
|
|
76
|
+
}, id);
|
|
77
|
+
await page.waitForSelector('#dev_ems_mode', { visible: true });
|
|
78
|
+
}
|
|
79
|
+
async function keepDraft() { await page.click('#btnSaveDevice'); await page.waitForSelector('#modalDevice.open', { hidden: true }); }
|
|
80
|
+
await edit('evcs1');
|
|
81
|
+
assert.equal(await page.$eval('#dev_ems_mode', e => e.value), 'auto');
|
|
82
|
+
assert.match(await page.$eval('#dev_ems_help', e => e.textContent), /automatisch unter Ladepunkte/);
|
|
83
|
+
await page.select('#dev_ems_chargerType', 'ac'); await page.select('#dev_ems_phases', '3');
|
|
84
|
+
await page.type('#dev_ems_minCurrentA', '6'); await page.type('#dev_ems_maxCurrentA', '16');
|
|
85
|
+
await keepDraft();
|
|
86
|
+
await edit('meter1');
|
|
87
|
+
await page.select('#dev_ems_mode', 'generationMeter');
|
|
88
|
+
assert.equal(await page.$eval('#dev_ems_slot', e => e.options.length), 7);
|
|
89
|
+
await page.select('#dev_ems_slot', '1');
|
|
90
|
+
assert.equal(await page.$eval('#dev_ems_scope_field', e => e.hidden), true);
|
|
91
|
+
await keepDraft();
|
|
92
|
+
await edit('pv1'); await page.select('#dev_ems_mode', 'pvInverter'); await page.select('#dev_ems_slot', '2'); await keepDraft();
|
|
93
|
+
await edit('storage1'); await page.select('#dev_ems_mode', 'storageFarm'); await page.select('#dev_ems_scope', 'M0');
|
|
94
|
+
await page.select('#dev_ems_coupling', 'dc'); await page.type('#dev_ems_maxChargeW', '10000'); await page.type('#dev_ems_maxDischargeW', '10000'); await page.type('#dev_ems_capacityKWh', '20');
|
|
95
|
+
if (screenshots) { await fs.mkdir(screenshots, { recursive: true }); await page.screenshot({ path: path.join(screenshots, 'devices-ems-desktop.png') }); }
|
|
96
|
+
await keepDraft();
|
|
97
|
+
await page.click('#eosModuleSave');
|
|
98
|
+
await page.waitForFunction(() => document.getElementById('eosEmsStatus').textContent.includes('4 Gerät(e) zugeordnet') && !document.getElementById('eosDeviceEditor').inert);
|
|
99
|
+
assert.equal(received.filter(r => r.method === 'PUT').length, 1);
|
|
100
|
+
const byId = Object.fromEntries(config.devices.map(d => [d.id, d]));
|
|
101
|
+
assert.equal(byId.evcs1.ems.mode, 'auto'); assert.equal(byId.evcs1.ems.activation.limits.maxCurrentA, 16);
|
|
102
|
+
assert.equal(byId.meter1.ems.mode, 'generationMeter'); assert.equal(byId.meter1.ems.flowSlot, 1);
|
|
103
|
+
assert.equal(byId.pv1.ems.mode, 'pvInverter'); assert.equal(byId.pv1.ems.flowSlot, 2);
|
|
104
|
+
assert.equal(byId.storage1.ems.mode, 'storageFarm'); assert.equal(byId.storage1.ems.scope, 'M0'); assert.equal(byId.storage1.ems.activation.limits.capacityKWh, 20);
|
|
105
|
+
for (const device of config.devices) { assert.equal(device.ems.activation.requested, true); assert.match(device.ems.activation.requestId, /^[0-9a-f-]{36}$/); }
|
|
106
|
+
assert.deepEqual(config.futureModuleSetting, { retain: true });
|
|
107
|
+
for (const d of config.devices) { assert.equal(d.futureSetting, 'keep'); assert.equal(d.connection.password, '__EOS_SECRET_UNCHANGED__'); assert.equal(d.connection.customRetained, 9); }
|
|
108
|
+
assert.match(await page.$eval('[data-eos-ems-id="evcs1"]', e => e.textContent), /EMS eingerichtet/);
|
|
109
|
+
assert.equal(await page.$eval('a[href*="tab=evcs"]', e => e.target), '');
|
|
110
|
+
await edit('meter1');
|
|
111
|
+
await page.$eval('#dev_name', e => { e.value = 'Unsaved customer name'; e.dispatchEvent(new Event('input', { bubbles: true })); });
|
|
112
|
+
const before = reads;
|
|
113
|
+
await page.$eval('#eosEmsRefresh', e => e.click());
|
|
114
|
+
await page.waitForFunction(() => document.getElementById('eosEmsStatus').textContent.includes('4 Gerät(e) zugeordnet'));
|
|
115
|
+
assert.ok(reads > before, 'status refresh actually read the server');
|
|
116
|
+
assert.equal(await page.$eval('#dev_name', e => e.value), 'Unsaved customer name', 'status refresh never reloads the form');
|
|
117
|
+
await page.select('#dev_ems_mode', 'gridMeter'); await page.select('#dev_ems_scope', 'M1');
|
|
118
|
+
assert.equal(await page.$eval('#dev_ems_slot_field', e => e.hidden), true);
|
|
119
|
+
await page.setViewport({ width: 390, height: 844 });
|
|
120
|
+
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1), true, 'no page horizontal overflow');
|
|
121
|
+
assert.equal(await page.$eval('.nexo-ems-config', e => { const b = e.getBoundingClientRect(); return b.left >= 0 && b.right <= window.innerWidth; }), true);
|
|
122
|
+
await page.$eval('.modal-content', e => { e.scrollTop = 0; });
|
|
123
|
+
if (screenshots) await page.screenshot({ path: path.join(screenshots, 'devices-ems-mobile.png') });
|
|
124
|
+
await page.click('#btnCancelDevice');
|
|
125
|
+
await page.reload();
|
|
126
|
+
await page.waitForFunction(() => !document.getElementById('eosDeviceEditor').inert);
|
|
127
|
+
await page.click('a[href="#tabDevices"]'); await edit('meter1');
|
|
128
|
+
assert.equal(await page.$eval('#dev_ems_mode', e => e.value), 'generationMeter');
|
|
129
|
+
assert.equal(await page.$eval('#dev_ems_slot', e => e.value), '1');
|
|
130
|
+
assert.equal(await page.$eval('#dev_name', e => e.value), 'meter1');
|
|
131
|
+
assert.deepEqual(errors, []);
|
|
132
|
+
});
|
|
@@ -50,7 +50,7 @@ export interface HostedRuntime {
|
|
|
50
50
|
_stopWriteLoop?(): void;
|
|
51
51
|
_createDriver(): Driver;
|
|
52
52
|
initObjects(): Promise<unknown>;
|
|
53
|
-
start(): Promise<unknown>;
|
|
53
|
+
start(options?: { backgroundInitialPoll?: boolean }): Promise<unknown>;
|
|
54
54
|
stop(): Promise<unknown>;
|
|
55
55
|
handleStateChange(id: string, state: State): Promise<unknown>;
|
|
56
56
|
}
|
|
@@ -12,7 +12,7 @@ export default [
|
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
files: ['**/admin/host-bridge.js'],
|
|
15
|
+
files: ['**/admin/host-bridge.js', '**/admin/ems-assignment.js'],
|
|
16
16
|
languageOptions: { sourceType: 'script', globals: { ...globals.browser, load: 'readonly', save: 'readonly', sendTo: 'readonly' } },
|
|
17
17
|
},
|
|
18
18
|
];
|
package/modules/devices/index.js
CHANGED
|
@@ -78,6 +78,39 @@ function validateConfig(input = {}) {
|
|
|
78
78
|
if (typeof device.templateId !== 'string' || !device.templateId || device.templateId.length > 160) throw failure('EOS_DEVICES_CONFIG_TEMPLATE');
|
|
79
79
|
if (!PROTOCOLS.includes(device.protocol)) throw failure('EOS_DEVICES_CONFIG_PROTOCOL');
|
|
80
80
|
if (device.enabled !== undefined && typeof device.enabled !== 'boolean') throw failure('EOS_DEVICES_CONFIG_ENABLED');
|
|
81
|
+
if (device.ems !== undefined) {
|
|
82
|
+
if (!record(device.ems) || Object.keys(device.ems).some(key => !['mode', 'scope', 'flowSlot', 'group', 'activation'].includes(key))) throw failure('EOS_DEVICES_EMS_INTENT');
|
|
83
|
+
const intent = device.ems;
|
|
84
|
+
if (typeof intent.mode !== 'string' || !['auto', 'monitor', 'manual', 'singleStorage', 'storageFarm', 'gridMeter', 'generationMeter', 'consumptionMeter', 'pvInverter'].includes(intent.mode)) throw failure('EOS_DEVICES_EMS_INTENT');
|
|
85
|
+
if (intent.scope !== undefined && (typeof intent.scope !== 'string' || !['M0', 'M1'].includes(intent.scope))) throw failure('EOS_DEVICES_EMS_SCOPE');
|
|
86
|
+
if (intent.group !== undefined && (typeof intent.group !== 'string' || !/^[A-Za-z0-9_-]{1,80}$/.test(intent.group))) throw failure('EOS_DEVICES_EMS_GROUP');
|
|
87
|
+
if (intent.flowSlot !== undefined && (typeof intent.flowSlot !== 'number' || !Number.isInteger(intent.flowSlot) || intent.flowSlot < 0 || intent.flowSlot > 10)) throw failure('EOS_DEVICES_EMS_SLOT');
|
|
88
|
+
if (['generationMeter', 'pvInverter'].includes(intent.mode) && (typeof intent.flowSlot !== 'number' || intent.flowSlot < 0 || intent.flowSlot > 5)) throw failure('EOS_DEVICES_EMS_SLOT');
|
|
89
|
+
if (intent.mode === 'consumptionMeter' && (typeof intent.flowSlot !== 'number' || intent.flowSlot < 1 || intent.flowSlot > 10)) throw failure('EOS_DEVICES_EMS_SLOT');
|
|
90
|
+
if (['singleStorage', 'storageFarm', 'gridMeter'].includes(intent.mode) && intent.scope === undefined) throw failure('EOS_DEVICES_EMS_SCOPE');
|
|
91
|
+
if (intent.activation !== undefined) {
|
|
92
|
+
const activation = intent.activation;
|
|
93
|
+
if (!record(activation) || Object.keys(activation).some(key => !['requested', 'requestId', 'limits'].includes(key))
|
|
94
|
+
|| typeof activation.requested !== 'boolean' || typeof activation.requestId !== 'string'
|
|
95
|
+
|| !/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(activation.requestId)) throw failure('EOS_DEVICES_EMS_ACTIVATION');
|
|
96
|
+
if (activation.limits !== undefined) {
|
|
97
|
+
const limits = activation.limits;
|
|
98
|
+
const numbers = ['maxChargeW', 'maxDischargeW', 'capacityKWh', 'minCurrentA', 'maxCurrentA', 'minPowerW', 'maxPowerW'];
|
|
99
|
+
if (!record(limits) || Object.keys(limits).some(key => ![...numbers, 'coupling', 'chargerType', 'phases'].includes(key))) throw failure('EOS_DEVICES_EMS_LIMITS');
|
|
100
|
+
for (const key of numbers) {
|
|
101
|
+
const value = Reflect.get(limits, key);
|
|
102
|
+
if (value !== undefined && (typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || value > 10000000)) throw failure('EOS_DEVICES_EMS_LIMITS');
|
|
103
|
+
}
|
|
104
|
+
for (const key of ['coupling', 'chargerType']) {
|
|
105
|
+
const value = Reflect.get(limits, key);
|
|
106
|
+
if (value !== undefined && (typeof value !== 'string' || !['ac', 'dc'].includes(value))) throw failure('EOS_DEVICES_EMS_LIMITS');
|
|
107
|
+
}
|
|
108
|
+
if (limits.phases !== undefined && (typeof limits.phases !== 'number' || ![1, 3].includes(limits.phases))) throw failure('EOS_DEVICES_EMS_LIMITS');
|
|
109
|
+
if (typeof limits.minCurrentA === 'number' && typeof limits.maxCurrentA === 'number' && limits.minCurrentA > limits.maxCurrentA
|
|
110
|
+
|| typeof limits.minPowerW === 'number' && typeof limits.maxPowerW === 'number' && limits.minPowerW > limits.maxPowerW) throw failure('EOS_DEVICES_EMS_LIMITS');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
81
114
|
if (device.connection !== undefined && !record(device.connection)) throw failure('EOS_DEVICES_CONFIG_CONNECTION');
|
|
82
115
|
const connection = device.connection || {};
|
|
83
116
|
if (connection.insecureTls === true || connection.insecureTLS === true || connection.allowInsecureTls === true || connection.rejectUnauthorized === false) throw failure('EOS_DEVICES_TLS_VERIFICATION_REQUIRED');
|
|
@@ -216,8 +249,13 @@ function createHostedModule({ adapter, canOperate, config = {}, runtimeFactory }
|
|
|
216
249
|
if (statusBusy || stopping) return;
|
|
217
250
|
statusBusy = true;
|
|
218
251
|
try {
|
|
219
|
-
|
|
220
|
-
|
|
252
|
+
// The host owns shutdown and its confirmation. A temporarily expired
|
|
253
|
+
// lease must not stop this module behind the host's back and leave a
|
|
254
|
+
// permanently inactive runtime labelled RUNNING after lease renewal.
|
|
255
|
+
// Every driver operation remains synchronously gated by permitted().
|
|
256
|
+
const allowed = permitted();
|
|
257
|
+
if (active) state = allowed ? 'running' : 'blocked';
|
|
258
|
+
await writeConnection(allowed && [...runtimes.values()].some(runtime => runtime.started && runtime._hbOnline === true));
|
|
221
259
|
} finally { statusBusy = false; }
|
|
222
260
|
}
|
|
223
261
|
async function start() {
|
|
@@ -249,20 +287,30 @@ function createHostedModule({ adapter, canOperate, config = {}, runtimeFactory }
|
|
|
249
287
|
const { DeviceRuntime } = require('./lib/deviceRuntime');
|
|
250
288
|
factory = (device, template) => /** @type {HostedRuntime} */ (/** @type {unknown} */ (new DeviceRuntime(adapter, device, template, settings)));
|
|
251
289
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
290
|
+
const pendingDevices = settings.devices.filter(device => device.enabled !== false);
|
|
291
|
+
let nextDevice = 0;
|
|
292
|
+
const startDevice = async () => {
|
|
293
|
+
while (nextDevice < pendingDevices.length) {
|
|
294
|
+
const device = pendingDevices[nextDevice++];
|
|
295
|
+
if (device.enabled === false) continue;
|
|
296
|
+
if (!permitted() || epoch !== generation) throw failure('EOS_DEVICES_STOPPED');
|
|
297
|
+
const template = structuredClone(catalog.byId.get(device.templateId));
|
|
298
|
+
if (!factory || !template) throw failure('EOS_DEVICES_RUNTIME_UNAVAILABLE');
|
|
299
|
+
const runtime = factory(structuredClone(device), template);
|
|
300
|
+
const createDriver = runtime._createDriver;
|
|
301
|
+
runtime._createDriver = function hostedDriver() { return guardDriver(createDriver.call(this), permitted); };
|
|
302
|
+
runtimes.set(device.id, runtime); // Include partially initialized runtimes in cleanup.
|
|
303
|
+
await runtime.initObjects();
|
|
304
|
+
if (!permitted() || epoch !== generation) throw failure('EOS_DEVICES_STOPPED');
|
|
305
|
+
await runtime.start({ backgroundInitialPoll: true });
|
|
306
|
+
if (!permitted() || epoch !== generation) { await runtime.stop(); throw failure('EOS_DEVICES_STOPPED'); }
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
// Bound object provisioning to four workers. Initial network reads
|
|
310
|
+
// remain owned by each runtime and never serialize all other devices.
|
|
311
|
+
const results = await Promise.allSettled(Array.from({ length: Math.min(4, pendingDevices.length) }, startDevice));
|
|
312
|
+
const failed = results.find(result => result.status === 'rejected');
|
|
313
|
+
if (failed?.status === 'rejected') throw failed.reason;
|
|
266
314
|
if (!permitted() || epoch !== generation) throw failure('EOS_DEVICES_STOPPED');
|
|
267
315
|
state = 'running';
|
|
268
316
|
timer = setInterval(() => { void refresh().catch(() => { lastError = 'EOS_DEVICES_STATUS_FAILED'; }); }, 1000);
|