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
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/* Copyright (c) 2026 NexoWatt. Confidential and proprietary. */
|
|
2
|
+
'use strict';
|
|
3
|
+
const test = require('node:test');
|
|
4
|
+
const assert = require('node:assert/strict');
|
|
5
|
+
const vm = require('node:vm');
|
|
6
|
+
const fs = require('node:fs');
|
|
7
|
+
const path = require('node:path');
|
|
8
|
+
const { validateConfig } = require('..');
|
|
9
|
+
const source = fs.readFileSync(path.join(__dirname, '../admin/ems-assignment.js'), 'utf8');
|
|
10
|
+
|
|
11
|
+
function browser() {
|
|
12
|
+
class Element { constructor() { this.dataset = {}; this.textContent = ''; } }
|
|
13
|
+
const summary = new Element();
|
|
14
|
+
const row = new Element(); row.dataset = { eosEmsId: 'evcs1', eosEmsMode: 'auto', eosEmsEnabled: 'true' };
|
|
15
|
+
const window = {};
|
|
16
|
+
vm.runInNewContext(source, { window, crypto: require('node:crypto').webcrypto, HTMLElement: Element, document: { getElementById: () => summary, querySelectorAll: () => [row] } });
|
|
17
|
+
return { api: window.EosDeviceEms, row, summary };
|
|
18
|
+
}
|
|
19
|
+
const device = { id: 'evcs1', templateId: 'fixture.template', protocol: 'modbusTcp', enabled: true, connection: { host: '192.0.2.50' } };
|
|
20
|
+
const saved = ems => validateConfig({ enabled: true, devices: [{ ...device, ems }] }).devices[0].ems;
|
|
21
|
+
|
|
22
|
+
test('known charging profiles show automatic assignment while storage and meters offer explicit role selection', () => {
|
|
23
|
+
const { api } = browser();
|
|
24
|
+
assert.deepEqual(Array.from(api.modes('EVCS'), item => item.value), ['auto', 'monitor', 'manual']);
|
|
25
|
+
assert.match(api.help('EVCS', 'auto', ''), /automatisch unter Ladepunkte/);
|
|
26
|
+
assert.doesNotMatch(api.help('DC_CHARGER', 'auto', ''), /automatisch unter Ladepunkte/);
|
|
27
|
+
assert.ok(api.modes('ESS').some(item => item.value === 'singleStorage'));
|
|
28
|
+
assert.ok(api.modes('ESS').some(item => item.value === 'storageFarm'));
|
|
29
|
+
assert.ok(api.modes('METER').some(item => item.value === 'gridMeter'));
|
|
30
|
+
assert.ok(api.modes('METER').some(item => item.value === 'generationMeter'));
|
|
31
|
+
assert.ok(api.modes('METER').some(item => item.value === 'consumptionMeter'));
|
|
32
|
+
assert.ok(api.modes('PV_INVERTER').some(item => item.value === 'pvInverter'));
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('energy flow choices are the six existing generation fields and ten consumers, without invented aggregation', () => {
|
|
36
|
+
const { api } = browser();
|
|
37
|
+
assert.deepEqual(Array.from(api.targets('pvInverter'), item => item.value), [0, 1, 2, 3, 4, 5]);
|
|
38
|
+
assert.deepEqual(Array.from(api.targets('generationMeter'), item => item.value), [0, 1, 2, 3, 4, 5]);
|
|
39
|
+
assert.deepEqual(Array.from(api.targets('consumptionMeter'), item => item.value), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
|
|
40
|
+
assert.equal(api.targets('storageFarm').length, 0);
|
|
41
|
+
assert.match(api.help('METER', 'generationMeter', ''), /nicht doppelt/);
|
|
42
|
+
assert.match(api.help('ESS', 'singleStorage', 'M1'), /keine automatische Steuerfreigabe/);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
for (const intent of [
|
|
46
|
+
{ mode: 'auto' }, { mode: 'monitor' }, { mode: 'manual' },
|
|
47
|
+
{ mode: 'singleStorage', scope: 'M0' }, { mode: 'storageFarm', scope: 'M1' },
|
|
48
|
+
{ mode: 'gridMeter', scope: 'M1' }, { mode: 'generationMeter', flowSlot: 0 },
|
|
49
|
+
{ mode: 'pvInverter', flowSlot: 5 }, { mode: 'consumptionMeter', flowSlot: 10 },
|
|
50
|
+
]) test(`device config round-trip preserves EMS intent ${JSON.stringify(intent)}`, () => assert.deepEqual(saved(intent), intent));
|
|
51
|
+
|
|
52
|
+
for (const intent of [
|
|
53
|
+
null, [], { mode: 'runHardware' }, { mode: 'auto', command: 'run' },
|
|
54
|
+
{ mode: 'singleStorage' }, { mode: 'gridMeter', scope: 'M2' },
|
|
55
|
+
{ mode: 'auto', scope: 0 }, { mode: 'auto', group: '../foreign' },
|
|
56
|
+
{ mode: 'generationMeter', flowSlot: 6 }, { mode: 'pvInverter', flowSlot: '1' },
|
|
57
|
+
{ mode: 'pvInverter', flowSlot: 0.5 }, { mode: 'consumptionMeter', flowSlot: 0 },
|
|
58
|
+
{ mode: 'consumptionMeter', flowSlot: 11 }, { mode: 'consumptionMeter' },
|
|
59
|
+
]) test(`malformed EMS intent is rejected before save: ${JSON.stringify(intent)}`, () => assert.throws(() => saved(intent), /EOS_DEVICES_EMS_/));
|
|
60
|
+
|
|
61
|
+
test('updating an older device preserves existing fields and does not invent an EMS intent', () => {
|
|
62
|
+
const original = { ...device, futureSetting: { x: 4 } };
|
|
63
|
+
const normalized = validateConfig({ devices: [original] });
|
|
64
|
+
assert.deepEqual(normalized.devices[0], original);
|
|
65
|
+
assert.equal(normalized.devices[0].ems, undefined);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('public mapping status is plain text, identifies commissioning and never claims hardware activation', () => {
|
|
69
|
+
const { api, row, summary } = browser();
|
|
70
|
+
api.render({ state: 'ready', statuses: [{ deviceId: 'evcs1', status: 'mapped', code: 'COMMISSIONING_REQUIRED' }] });
|
|
71
|
+
assert.match(row.textContent, /Zugeordnet/);
|
|
72
|
+
assert.match(row.textContent, /EMS-Verwendung/);
|
|
73
|
+
assert.match(summary.textContent, /1 Gerät\(e\) zugeordnet/);
|
|
74
|
+
api.render({ state: 'ready', statuses: [{ deviceId: 'evcs1', status: 'conflict', code: '<img src=x onerror=alert(1)>' }] });
|
|
75
|
+
assert.equal(row.dataset.state, 'conflict');
|
|
76
|
+
assert.doesNotMatch(row.textContent, /<img/);
|
|
77
|
+
assert.match(row.textContent, /bleibt erhalten/);
|
|
78
|
+
assert.match(summary.textContent, /1 Zuordnungskonflikt/);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('pending and stopped status do not overwrite the device draft or masquerade as a failed save', () => {
|
|
82
|
+
const { api, summary } = browser();
|
|
83
|
+
const draft = { name: 'Unstored name', ems: { mode: 'storageFarm', scope: 'M0' } };
|
|
84
|
+
const before = structuredClone(draft);
|
|
85
|
+
api.render({ state: 'error', statuses: [] });
|
|
86
|
+
assert.match(summary.textContent, /Geräte gespeichert/);
|
|
87
|
+
assert.deepEqual(draft, before);
|
|
88
|
+
api.render({ state: 'stopped', statuses: [] });
|
|
89
|
+
assert.match(summary.textContent, /pausiert/);
|
|
90
|
+
api.render({ state: 'ready', statuses: [{ deviceId: 'evcs1', status: 'mapped' }] });
|
|
91
|
+
assert.equal(api.describe('evcs1', { mode: 'auto' }, false).status, 'disabled');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('partial mappings remain visibly incomplete and occupied targets explain the preserved mapping', () => {
|
|
95
|
+
const { api, row, summary } = browser();
|
|
96
|
+
api.render({ state: 'ready', statuses: [{ devId: 'evcs1', status: 'mapped', code: 'MAPPING_INCOMPLETE', missing: ['powerId', 'onlineId|heartbeatId', '<script>secret</script>'] }] });
|
|
97
|
+
assert.equal(row.dataset.state, 'pending');
|
|
98
|
+
assert.match(row.textContent, /Teilweise zugeordnet/);
|
|
99
|
+
assert.match(row.textContent, /Fehlt: Leistungsmesswert, Verbindungsstatus/);
|
|
100
|
+
assert.doesNotMatch(row.textContent, /<script>/);
|
|
101
|
+
assert.match(summary.textContent, /0 Gerät\(e\) zugeordnet · 1 unvollständig/);
|
|
102
|
+
assert.equal(summary.dataset.state, 'pending');
|
|
103
|
+
api.render({ state: 'ready', statuses: [{ devId: 'evcs1', status: 'conflict', code: 'MEASUREMENT_ALREADY_ASSIGNED' }] });
|
|
104
|
+
assert.match(row.textContent, /Doppelzählung vermeiden/);
|
|
105
|
+
api.render({ state: 'ready', statuses: [{ devId: 'evcs1', status: 'manual', code: 'MONITOR_ONLY' }] });
|
|
106
|
+
assert.match(row.textContent, /automatisch verwaltete Steuereinträge deaktiviert/);
|
|
107
|
+
assert.match(api.help('ESS', 'monitor', ''), /Andere manuelle Einträge bleiben unverändert/);
|
|
108
|
+
assert.match(api.help('ESS', 'monitor', ''), /spätere Betriebsfreigabe erfolgt durch ausdrückliche/);
|
|
109
|
+
assert.match(api.help('ESS', 'manual', ''), /beendet keine bestehende Regelung/);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test('optional manufacturer readback is distinguished from required missing data', () => {
|
|
113
|
+
const { api, row, summary } = browser();
|
|
114
|
+
api.render({ state: 'ready', statuses: [{ devId: 'evcs1', status: 'mapped', code: 'COMMISSIONING_REQUIRED', optionalMissing: ['feneconActualSetpointId', '<img>'] }] });
|
|
115
|
+
assert.equal(row.dataset.state, 'mapped');
|
|
116
|
+
assert.match(api.describe('evcs1', {}, true).optionalDetail, /Optional nicht verfügbar: Rückmeldung des tatsächlich angewendeten Sollwerts/);
|
|
117
|
+
assert.doesNotMatch(row.textContent, /<img>|Fehlt:/);
|
|
118
|
+
assert.match(summary.textContent, /1 Gerät\(e\) zugeordnet/);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('profile-independent optional aliases and numeric mapping errors remain clear for every manufacturer', () => {
|
|
122
|
+
const { api, row } = browser();
|
|
123
|
+
api.render({ state: 'ready', statuses: [{ devId: 'evcs1', status: 'mapped', code: 'COMMISSIONING_REQUIRED',
|
|
124
|
+
optionalMissing: ['r.pvPowerDc', 'futureVendorExtraId', 'feneconNvpPowerObjectId'] }] });
|
|
125
|
+
assert.equal(row.dataset.state, 'mapped');
|
|
126
|
+
assert.match(api.describe('evcs1', {}, true).optionalDetail, /PV-Leistung DC/); assert.match(api.describe('evcs1', {}, true).optionalDetail, /Netzanschlussleistung/);
|
|
127
|
+
assert.match(api.describe('evcs1', {}, true).optionalDetail, /1 weitere profilabhängige Datenpunkt-Zuordnung/);
|
|
128
|
+
assert.doesNotMatch(row.textContent, /futureVendor|feneconNvp/);
|
|
129
|
+
api.render({ state: 'ready', statuses: [{ devId: 'evcs1', status: 'mapped', code: 'MAPPING_INCOMPLETE', missing: ['invalid:pvPowerId'] }] });
|
|
130
|
+
assert.equal(row.dataset.state, 'pending');
|
|
131
|
+
assert.match(row.textContent, /Eine Zahl ersetzt keinen Datenpunkt/);
|
|
132
|
+
assert.match(row.textContent, /Gerätefunktionen oder Einstellungen/);
|
|
133
|
+
api.render({ state: 'ready', statuses: [{ devId: 'evcs1', status: 'mapped', code: 'MAPPING_INCOMPLETE', missing: ['review:feneconGridSetpointObjectId'] }] });
|
|
134
|
+
assert.match(row.textContent, /Regelungsart.*ausdrücklich prüfen/);
|
|
135
|
+
assert.match(row.textContent, /bisherige Direktregelung bleibt erhalten/);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
async function pollingFixture() {
|
|
139
|
+
const elements = new Map(); const timers = new Map(); const events = new Map();
|
|
140
|
+
let timerId = 0; let loads = 0; let reads = 0; let renders = 0;
|
|
141
|
+
let draft = {}; let onChange = () => {};
|
|
142
|
+
const node = id => {
|
|
143
|
+
if (!elements.has(id)) elements.set(id, { textContent: '', dataset: {}, events: {}, addEventListener(name, handler) { this.events[name] = handler; } });
|
|
144
|
+
return elements.get(id);
|
|
145
|
+
};
|
|
146
|
+
const context = { Error, AbortSignal, Promise, window: {
|
|
147
|
+
EosDeviceEms: { render() { renders++; } },
|
|
148
|
+
setTimeout(callback) { const id = ++timerId; timers.set(id, callback); return id; },
|
|
149
|
+
clearTimeout(id) { timers.delete(id); }, addEventListener(name, callback) { events.set(name, callback); },
|
|
150
|
+
}, document: { hidden: false, getElementById: node, querySelectorAll: () => [], addEventListener(name, callback) { events.set(name, callback); } },
|
|
151
|
+
async load(config, changed) { loads++; draft = structuredClone(config); onChange = changed; },
|
|
152
|
+
save(callback) { callback(draft); },
|
|
153
|
+
async fetch(_url, options) {
|
|
154
|
+
assert.equal(options.method, undefined, 'status polling never sends a mutation'); reads++;
|
|
155
|
+
return { status: 200, ok: true, json: async () => ({ config: { enabled: true, devices: [{ id: 'evcs1', name: 'Stored' }] },
|
|
156
|
+
csrfToken: 'fixture-csrf', configurationReady: true, emsCommissioning: { state: 'pending', statuses: [] } }) };
|
|
157
|
+
} };
|
|
158
|
+
vm.runInNewContext(fs.readFileSync(path.join(__dirname, '../admin/host-bridge.js'), 'utf8'), context);
|
|
159
|
+
events.get('DOMContentLoaded')();
|
|
160
|
+
const settle = async () => { for (let i = 0; i < 10; i++) await new Promise(resolve => setImmediate(resolve)); };
|
|
161
|
+
await settle();
|
|
162
|
+
return { node, events, timers, loads: () => loads, reads: () => reads, renders: () => renders, draft: () => draft,
|
|
163
|
+
changed() { onChange(true); }, settle,
|
|
164
|
+
async tick() { const entry = timers.entries().next().value; assert.ok(entry); timers.delete(entry[0]); entry[1](); await settle(); },
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
test('bounded status polling and explicit refresh preserve unsaved device and EMS selections', async () => {
|
|
169
|
+
const f = await pollingFixture();
|
|
170
|
+
f.draft().devices[0].name = 'Customer draft';
|
|
171
|
+
f.draft().devices[0].ems = { mode: 'storageFarm', scope: 'M0' }; f.changed();
|
|
172
|
+
for (let i = 0; i < 30; i++) await f.tick();
|
|
173
|
+
assert.equal(f.reads(), 31, 'one initial read and thirty bounded status polls');
|
|
174
|
+
assert.equal(f.timers.size, 0, 'no endless polling after pending budget expires');
|
|
175
|
+
assert.equal(f.loads(), 1, 'polling never reloads the editable configuration');
|
|
176
|
+
assert.equal(f.renders(), 31);
|
|
177
|
+
f.node('eosEmsRefresh').events.click(); await f.settle();
|
|
178
|
+
assert.equal(f.loads(), 1); assert.equal(f.reads(), 32);
|
|
179
|
+
assert.equal(f.draft().devices[0].name, 'Customer draft');
|
|
180
|
+
assert.deepEqual(f.draft().devices[0].ems, { mode: 'storageFarm', scope: 'M0' });
|
|
181
|
+
assert.equal(f.node('eosModuleStatus').textContent, 'Ungespeicherte Änderungen.');
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
test('leaving the devices page cancels its pending EMS status poll', async () => {
|
|
185
|
+
const f = await pollingFixture();
|
|
186
|
+
assert.equal(f.timers.size, 1);
|
|
187
|
+
f.events.get('pagehide')();
|
|
188
|
+
assert.equal(f.timers.size, 0);
|
|
189
|
+
assert.equal(f.reads(), 1);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
test('missing service, empty READY, partial status and global errors never masquerade as completed commissioning', () => {
|
|
193
|
+
const { api, row, summary } = browser();
|
|
194
|
+
api.setDevices([{ id: 'evcs1' }, { id: 'meter1' }]);
|
|
195
|
+
api.render(undefined);
|
|
196
|
+
assert.equal(api.needsPolling(), true); assert.match(row.textContent, /Rückmeldung wird geladen/);
|
|
197
|
+
assert.doesNotMatch(row.textContent, /nach dem Speichern verfügbar/);
|
|
198
|
+
api.render({ state: 'ready', statuses: [] });
|
|
199
|
+
assert.equal(api.needsPolling(), true); assert.match(summary.textContent, /2 gespeicherte.*ohne EMS-Rückmeldung/);
|
|
200
|
+
assert.equal(summary.dataset.state, 'pending');
|
|
201
|
+
api.render({ state: 'ready', statuses: [{ deviceId: 'evcs1', status: 'mapped', code: 'ACTIVATION_APPLIED', activationApplied: true }] });
|
|
202
|
+
assert.equal(api.needsPolling(), true); assert.match(row.textContent, /EMS eingerichtet/);
|
|
203
|
+
assert.match(row.textContent, /wartet auf gültige Messwerte/);
|
|
204
|
+
api.render({ state: 'error', code: 'EOS_EMS_BRIDGE_UNAVAILABLE', statuses: [{ deviceId: 'evcs1', code: 'EOS_EMS_BRIDGE_UNAVAILABLE', status: 'pending' }] });
|
|
205
|
+
assert.equal(api.needsPolling(), false); assert.equal(row.dataset.state, 'conflict');
|
|
206
|
+
assert.match(row.textContent, /EMS-Verbindung nicht verfügbar/); assert.match(summary.textContent, /fehlgeschlagen/);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
test('explicit global Save commissions legacy selections once and retains the token across ambiguous retries and unrelated saves', () => {
|
|
210
|
+
const { api } = browser();
|
|
211
|
+
const old = { ...device, category: 'ESS', futureValue: 7, ems: { mode: 'storageFarm', scope: 'M0' } };
|
|
212
|
+
const prepared = api.prepareSave([old], [old]);
|
|
213
|
+
const json = value => JSON.parse(JSON.stringify(value));
|
|
214
|
+
assert.equal(prepared[0].ems.activation.requested, true);
|
|
215
|
+
assert.match(prepared[0].ems.activation.requestId, /^[0-9a-f-]{36}$/);
|
|
216
|
+
assert.equal(prepared[0].futureValue, 7); assert.equal(old.ems.activation, undefined);
|
|
217
|
+
assert.deepEqual(json(api.prepareSave([old], [old])), json(prepared), 'an explicit retry keeps the request token after an ambiguous response');
|
|
218
|
+
const edited = json(prepared); edited[0].name = 'New name';
|
|
219
|
+
assert.equal(api.prepareSave(edited, prepared)[0].ems.activation.requestId, prepared[0].ems.activation.requestId, 'renaming never re-enables a later disabled app');
|
|
220
|
+
const limits = json(prepared); limits[0].ems.activation.limits = { maxChargeW: 5000, maxDischargeW: 5000, coupling: 'dc', capacityKWh: 10 };
|
|
221
|
+
assert.notEqual(api.prepareSave(limits, prepared)[0].ems.activation.requestId, prepared[0].ems.activation.requestId);
|
|
222
|
+
api.setDevices(prepared); api.requestRenewal('evcs1');
|
|
223
|
+
assert.notEqual(api.prepareSave(prepared, prepared)[0].ems.activation.requestId, prepared[0].ems.activation.requestId, 'explicitly rechecking EMS use can renew an intentionally disabled app');
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
test('activation requests survive strict Devices persistence and malformed or unlimited limits are rejected', () => {
|
|
227
|
+
const { api } = browser();
|
|
228
|
+
const deviceWithIntent = { ...device, category: 'EVCS', ems: { mode: 'auto', activation: { requested: true,
|
|
229
|
+
limits: { chargerType: 'ac', phases: 3, minCurrentA: 6, maxCurrentA: 16 } } } };
|
|
230
|
+
const prepared = JSON.parse(JSON.stringify(api.prepareSave([deviceWithIntent], [])));
|
|
231
|
+
assert.deepEqual(validateConfig({ devices: prepared }).devices, prepared);
|
|
232
|
+
for (const mutation of [activation => { activation.requestId = 'invalid'; },
|
|
233
|
+
activation => { activation.limits.minCurrentA = 0; }, activation => { activation.limits.phases = 2; },
|
|
234
|
+
activation => { activation.limits.maxCurrentA = 5; }, activation => { activation.limits.command = 'enable'; }]) {
|
|
235
|
+
const invalid = structuredClone(prepared); mutation(invalid[0].ems.activation);
|
|
236
|
+
assert.throws(() => validateConfig({ devices: invalid }), /EOS_DEVICES_EMS_/);
|
|
237
|
+
}
|
|
238
|
+
const manual = { ...deviceWithIntent, ems: { mode: 'manual' } };
|
|
239
|
+
assert.equal(api.prepareSave([manual], [manual])[0].ems.activation, undefined);
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
test('profile capability chips use explicit datapoint metadata, not category or manufacturer guesses', () => {
|
|
243
|
+
const { api } = browser();
|
|
244
|
+
const template = { category: 'ESS', manufacturer: 'FENECON', datapoints: [
|
|
245
|
+
{ type: 'number', role: 'value.power', rw: 'ro', source: { kind: 'modbus', read: { fc: 4, address: 1 } } },
|
|
246
|
+
{ type: 'number', role: 'value.battery', unit: '%', rw: 'ro', source: { kind: 'modbus' } },
|
|
247
|
+
{ type: 'number', role: 'level.power', rw: 'wo', source: { kind: 'modbus', write: { fc: 16, address: 2 } } },
|
|
248
|
+
{ type: 'number', role: 'value.temperature', rw: 'wo', source: { kind: 'modbus' } },
|
|
249
|
+
{ type: 'number', role: 'value.energy', rw: 'ro' },
|
|
250
|
+
] };
|
|
251
|
+
assert.deepEqual(Array.from(api.capabilities(template)), ['Leistungsmessung', 'Ladezustand', 'Leistungsvorgabe', 'Schreibdatenpunkte']);
|
|
252
|
+
assert.deepEqual(Array.from(api.capabilities({ category: 'ESS', manufacturer: 'FENECON', datapoints: [] })), []);
|
|
253
|
+
assert.deepEqual(Array.from(api.capabilities({ category: 'PV_INVERTER', datapoints: [{ type: 'number', role: 'value', name: 'PVPower', rw: 'ro', source: { kind: 'modbus' } }] })), []);
|
|
254
|
+
const catalog = require('../lib/templates.json').templates;
|
|
255
|
+
assert.ok(api.capabilities(catalog.find(item => item.id === 'ess.fenecon.FeneconHomeEssImpl')).includes('Leistungsvorgabe'));
|
|
256
|
+
assert.ok(!api.capabilities(catalog.find(item => item.id === 'meter.sma.SmaEnergyMeterSpeedwireImpl')).includes('Leistungsvorgabe'));
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
test('a previous activation acknowledgement cannot confirm a newly saved request, while current errors stay visible', () => {
|
|
260
|
+
const { api, row, summary } = browser();
|
|
261
|
+
api.setDevices([{ id: 'evcs1', ems: { mode: 'auto', activation: { requested: true, requestId: 'new-request' } } }]);
|
|
262
|
+
api.render({ state: 'ready', statuses: [{ deviceId: 'evcs1', status: 'mapped', code: 'ACTIVATION_APPLIED', activationApplied: true, activationRequestId: 'previous-request' }] });
|
|
263
|
+
assert.equal(api.needsPolling(), true); assert.equal(row.dataset.state, 'pending');
|
|
264
|
+
assert.match(row.textContent, /bisherige Rückmeldung gilt nicht als neue Freigabe/);
|
|
265
|
+
assert.equal(summary.dataset.state, 'pending');
|
|
266
|
+
api.render({ state: 'ready', statuses: [{ deviceId: 'evcs1', status: 'pending', code: 'ACTIVATION_PENDING', missing: ['limit:maxChargeW', 'reference:powerId'] }] });
|
|
267
|
+
assert.match(row.textContent, /maximale Ladeleistung.*Leistungsmesswert/);
|
|
268
|
+
api.render({ state: 'ready', statuses: [{ deviceId: 'evcs1', status: 'mapped', code: 'ACTIVATION_APPLIED', activationApplied: true, activationRequestId: 'new-request' }] });
|
|
269
|
+
assert.equal(api.needsPolling(), false); assert.match(row.textContent, /EMS eingerichtet/);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
test('explicit profile or device-class change renews the binding-specific activation without renewing unrelated edits', () => {
|
|
273
|
+
const { api } = browser();
|
|
274
|
+
const original = { ...device, category: 'EVCS', ems: { mode: 'auto', activation: { requested: true, requestId: '0ef06100-32c6-4d34-baf4-e6503a205c22', limits: {} } } };
|
|
275
|
+
const changed = structuredClone(original); changed.templateId = 'fixture.other';
|
|
276
|
+
const prepared = api.prepareSave([changed], [original]);
|
|
277
|
+
assert.notEqual(prepared[0].ems.activation.requestId, original.ems.activation.requestId);
|
|
278
|
+
changed.category = 'EVSE';
|
|
279
|
+
assert.notEqual(api.prepareSave([changed], [original])[0].ems.activation.requestId, prepared[0].ems.activation.requestId);
|
|
280
|
+
const disabled = structuredClone(original); disabled.ems.activation.requested = false; disabled.templateId = 'fixture.other';
|
|
281
|
+
assert.equal(api.prepareSave([disabled], [disabled])[0].ems.activation.requestId, original.ems.activation.requestId);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
test('module runtime READY is only startup permission and failure never claims working telemetry', () => {
|
|
286
|
+
const { api } = browser();
|
|
287
|
+
const starting = api.runtimeStatus({ enabled: true, active: false, reason: 'READY', details: {} });
|
|
288
|
+
assert.equal(starting.state, 'starting'); assert.equal(starting.monitor, true);
|
|
289
|
+
assert.match(starting.text, /noch keine laufende Gerätekommunikation/);
|
|
290
|
+
const failed = api.runtimeStatus({ enabled: true, active: false, reason: 'START_FAILED_RESTART_REQUIRED', details: { lastError: 'credential-private-secret' } });
|
|
291
|
+
assert.equal(failed.state, 'error'); assert.match(failed.text, /konnte nicht starten/); assert.doesNotMatch(failed.text, /credential-private-secret/);
|
|
292
|
+
const waiting = api.runtimeStatus({ enabled: true, active: true, reason: 'RUNNING', details: { state: 'running', connected: false } });
|
|
293
|
+
assert.equal(waiting.state, 'waiting'); assert.match(waiting.text, /Noch keine aktuellen Gerätedaten bestätigt/);
|
|
294
|
+
const connected = api.runtimeStatus({ enabled: true, active: true, reason: 'RUNNING', details: { state: 'running', connected: true } });
|
|
295
|
+
assert.equal(connected.state, 'running'); assert.match(connected.text, /Messwertfrische je Gerät prüfen/);
|
|
296
|
+
assert.doesNotMatch(connected.text, /alle.*aktuell|alle.*normal|liefert aktuelle/i);
|
|
297
|
+
assert.equal(api.runtimeStatus({ enabled: false, reason: 'DISABLED' }).monitor, false);
|
|
298
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const assert = require('node:assert/strict');
|
|
4
|
+
const Module = require('node:module');
|
|
5
|
+
const originalLoad = Module._load;
|
|
6
|
+
Module._load = function (request, parent, main) {
|
|
7
|
+
if (request === 'modbus-serial') return class {};
|
|
8
|
+
if (request === 'serialport') return { SerialPort: class {} };
|
|
9
|
+
return originalLoad.call(this, request, parent, main);
|
|
10
|
+
};
|
|
11
|
+
let ModbusDriver;
|
|
12
|
+
try { ({ ModbusDriver } = require('../lib/drivers/modbus')); } finally { Module._load = originalLoad; }
|
|
13
|
+
const { guardDriver } = require('../operation-guard');
|
|
14
|
+
const template = require('../lib/templates.json').templates.find(row => row.id === 'ess.solax.SolaXHybridX1X3Ess');
|
|
15
|
+
const point = id => template.datapoints.find(row => row.id === id);
|
|
16
|
+
const denied = code => Object.assign(new Error(code), { code });
|
|
17
|
+
const illegal = () => Object.assign(new Error('Modbus exception 2'), { modbusCode: 2 });
|
|
18
|
+
function fixture(read) {
|
|
19
|
+
const logs = []; const calls = [];
|
|
20
|
+
const adapter = { log: Object.fromEntries(['debug', 'info', 'warn', 'error'].map(level => [level, message => logs.push({ level, message })])) };
|
|
21
|
+
const driver = new ModbusDriver(adapter, { id: 'solax', protocol: 'modbusTcp', templateId: template.id,
|
|
22
|
+
connection: { unitId: 1, minCommandIntervalMs: 0 } }, template, {});
|
|
23
|
+
driver.ensureConnected = async () => {};
|
|
24
|
+
const invoke = async (address, length) => { calls.push({ address, length }); return read(address, length); };
|
|
25
|
+
driver.client = { setID() {}, readInputRegisters: invoke, readHoldingRegisters: invoke, readCoils: invoke, readDiscreteInputs: invoke, close() {} };
|
|
26
|
+
return { driver, logs, calls };
|
|
27
|
+
}
|
|
28
|
+
function assertNotQuarantined(h) {
|
|
29
|
+
assert.equal(h.driver._readGroupSkipUntil.size, 0);
|
|
30
|
+
assert.equal(h.driver._readGroupWarnUntil.size, 0);
|
|
31
|
+
assert.equal(h.logs.some(row => /skipped temporarily/.test(row.message)), false);
|
|
32
|
+
assert.equal(h.driver._busy, false);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
test('actual hosted gate loss after one SolaX read aborts the snapshot without poisoning remaining optional groups', async () => {
|
|
36
|
+
let allowed = true; let revoke = true;
|
|
37
|
+
const h = fixture((address, length) => { if (revoke) allowed = false; return { data: Array(length).fill(42) }; });
|
|
38
|
+
const driver = guardDriver(h.driver, () => allowed);
|
|
39
|
+
try {
|
|
40
|
+
await assert.rejects(driver.readDatapoints([point('sOC'), point('gRID_POWER')]), { code: 'EOS_DEVICES_NOT_AUTHORIZED' });
|
|
41
|
+
assert.equal(h.calls.length, 1, 'dispatch gate prevents the next physical read'); assertNotQuarantined(h);
|
|
42
|
+
allowed = true; revoke = false; h.calls.length = 0;
|
|
43
|
+
const result = await driver.readDatapoints([point('sOC'), point('gRID_POWER')]);
|
|
44
|
+
assert.ok(Object.hasOwn(result, 'sOC')); assert.ok(Object.hasOwn(result, 'gRID_POWER'));
|
|
45
|
+
assert.deepEqual(h.calls.map(row => row.address), [28, 52], 'next permitted poll immediately reads both groups');
|
|
46
|
+
} finally { await driver.disconnect(); }
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('authorization and explicit stop errors bypass optional caching for registers, coils and discrete inputs', async () => {
|
|
50
|
+
for (const code of ['EOS_DEVICES_NOT_AUTHORIZED', 'EOS_DEVICES_STOPPED', 'EOS_MODULE_STOPPED', 'EOS_OWNERSHIP_REQUIRED']) {
|
|
51
|
+
for (const fc of [1, 2, 3, 4]) {
|
|
52
|
+
const error = denied(code); const h = fixture(() => { throw error; });
|
|
53
|
+
const dp = { id: 'optional', rw: 'ro', source: { kind: 'modbus', fc, address: 10, length: 1, dataType: 'uint16' } };
|
|
54
|
+
try { await assert.rejects(h.driver.readDatapoints([dp]), thrown => thrown === error); assertNotQuarantined(h); }
|
|
55
|
+
finally { await h.driver.disconnect(); }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('a gate error inside an already split read cannot blacklist an optional item or continue the other items', async () => {
|
|
61
|
+
const error = denied('EOS_DEVICES_NOT_AUTHORIZED'); const h = fixture(() => { throw error; });
|
|
62
|
+
h.driver._readGroupForceSplitUntil.set('1:4:50:53', Date.now() + 60000);
|
|
63
|
+
try {
|
|
64
|
+
await assert.rejects(h.driver.readDatapoints([point('pV_POWER'), point('gRID_POWER')]), thrown => thrown === error);
|
|
65
|
+
assertNotQuarantined(h); assert.equal(h.calls.length, 1);
|
|
66
|
+
} finally { await h.driver.disconnect(); }
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('authorization failure at a documented fallback is not swallowed as the original illegal-register response', async () => {
|
|
70
|
+
const error = denied('EOS_DEVICES_NOT_AUTHORIZED');
|
|
71
|
+
const h = fixture(address => { if (address === 52) throw illegal(); throw error; });
|
|
72
|
+
const dp = structuredClone(point('gRID_POWER')); dp.source.fallbackAddressOffsets = [1];
|
|
73
|
+
try {
|
|
74
|
+
await assert.rejects(h.driver.readDatapoints([dp]), thrown => thrown === error);
|
|
75
|
+
assertNotQuarantined(h); assert.deepEqual(h.calls.map(row => row.address), [52, 53]);
|
|
76
|
+
} finally { await h.driver.disconnect(); }
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test('genuine unsupported optional registers retain their existing cooldown while useful groups remain readable', async () => {
|
|
80
|
+
const h = fixture((address, length) => { if (address === 52) throw illegal(); return { data: Array(length).fill(42) }; });
|
|
81
|
+
try {
|
|
82
|
+
assert.deepEqual(await h.driver.readDatapoints([point('sOC'), point('gRID_POWER')]), { sOC: 42 });
|
|
83
|
+
assert.equal(h.driver._readGroupSkipUntil.has('1:4:52:53'), true);
|
|
84
|
+
assert.equal(h.logs.some(row => /skipped temporarily/.test(row.message)), true);
|
|
85
|
+
h.calls.length = 0;
|
|
86
|
+
assert.deepEqual(await h.driver.readDatapoints([point('sOC'), point('gRID_POWER')]), { sOC: 42 });
|
|
87
|
+
assert.deepEqual(h.calls.map(row => row.address), [28]);
|
|
88
|
+
} finally { await h.driver.disconnect(); }
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('authorization loss during optional SunSpec scanning is propagated and cannot cache an incomplete model map', async () => {
|
|
92
|
+
const error = denied('EOS_DEVICES_NOT_AUTHORIZED'); let blocked = true;
|
|
93
|
+
const h = fixture(() => { if (blocked) throw error; return { data: [65535, 0] }; });
|
|
94
|
+
h.driver._autoSunSpec = true; h.driver._maybeDiscoverSunSpec = async () => true;
|
|
95
|
+
try {
|
|
96
|
+
await assert.rejects(h.driver._maybeScanSunSpecModels(), thrown => thrown === error);
|
|
97
|
+
assert.notEqual(h.driver._sunSpecModelsScanned, true);
|
|
98
|
+
blocked = false;
|
|
99
|
+
assert.equal(await h.driver._maybeScanSunSpecModels(), true);
|
|
100
|
+
assert.equal(h.driver._sunSpecModelsScanned, true);
|
|
101
|
+
} finally { await h.driver.disconnect(); }
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
test('the read entry point does not hide an authorization error from optional model discovery', async () => {
|
|
105
|
+
const error = denied('EOS_DEVICES_NOT_AUTHORIZED'); const h = fixture(() => ({ data: [0] }));
|
|
106
|
+
h.driver._maybeScanSunSpecModels = async () => { throw error; };
|
|
107
|
+
const dp = structuredClone(point('gRID_POWER')); dp.source.sunspecModel = 101;
|
|
108
|
+
try {
|
|
109
|
+
await assert.rejects(h.driver.readDatapoints([dp]), thrown => thrown === error);
|
|
110
|
+
assertNotQuarantined(h); assert.equal(h.calls.length, 0);
|
|
111
|
+
} finally { await h.driver.disconnect(); }
|
|
112
|
+
});
|
|
@@ -62,7 +62,7 @@ test('MQTT diagnostic-only snapshots update aliases without clearing errors or f
|
|
|
62
62
|
await runtime._handleMqttSnapshot({ errors: 2 }, { connected: true, diagnosticsOnly: true });
|
|
63
63
|
assert.equal(states.get('devices.test.info.connection').val, false);
|
|
64
64
|
assert.equal(states.get('devices.test.info.lastError').val, 'No current telemetry');
|
|
65
|
-
assert.deepEqual(received, { values: { errors: 2 }, context: { connected: false, lastError: 'No current telemetry' } });
|
|
65
|
+
assert.deepEqual(received, { values: { errors: 2 }, context: { connected: false, lastError: 'No current telemetry', diagnosticsOnly: true } });
|
|
66
66
|
assert.equal(runtime._hbLastSeen, 0);
|
|
67
67
|
});
|
|
68
68
|
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const assert = require('node:assert/strict');
|
|
4
|
+
const dgram = require('node:dgram');
|
|
5
|
+
const { SpeedwireDriver } = require('../lib/drivers/speedwire');
|
|
6
|
+
const { validateConfig, preflightLegacyConfig } = require('../index');
|
|
7
|
+
|
|
8
|
+
const points = [{ id: 'power', rw: 'ro', source: { kind: 'speedwire', computed: 'netActivePower' } },
|
|
9
|
+
{ id: 'seen', rw: 'ro', source: { kind: 'speedwire', field: 'lastSeenUnixMs' } }];
|
|
10
|
+
function telegram(powerKw) {
|
|
11
|
+
const data = Buffer.alloc(52); data.write('SMA\0'); data.writeUInt16BE(0x6069, 16);
|
|
12
|
+
data.writeUInt16BE(1, 18); data.writeUInt32BE(12345678, 20); data.writeUInt32BE(1000, 24);
|
|
13
|
+
data.set([0, 1, 4, 0], 28); data.writeInt32BE(Math.round(powerKw * 10000), 32);
|
|
14
|
+
data.set([0, 2, 4, 0], 36); data.writeInt32BE(0, 40); return data;
|
|
15
|
+
}
|
|
16
|
+
const close = socket => new Promise(resolve => { try { socket.close(resolve); } catch { resolve(); } });
|
|
17
|
+
async function bind(socket) { await new Promise((resolve, reject) => { socket.once('error', reject); socket.bind(0, '0.0.0.0', resolve); }); return socket.address().port; }
|
|
18
|
+
async function fixture(t, reserve = false) {
|
|
19
|
+
const reservation = dgram.createSocket({ type: 'udp4', reuseAddr: false }); const port = await bind(reservation);
|
|
20
|
+
if (!reserve) await close(reservation);
|
|
21
|
+
const logs = []; const adapter = { namespace: `test.speedwire.${port}`, log: { debug: text => logs.push(text), warn: text => logs.push(text) } };
|
|
22
|
+
const driver = new SpeedwireDriver(adapter, { id: 'sma', connection: { port, multicastGroup: '127.0.0.1', host: '127.0.0.1' } });
|
|
23
|
+
const sender = dgram.createSocket('udp4');
|
|
24
|
+
t.after(async () => { await driver.disconnect(); await close(sender); await close(reservation); });
|
|
25
|
+
async function send(powerKw) {
|
|
26
|
+
const socket = driver.hub.socket;
|
|
27
|
+
assert.ok(socket && driver.hub.started, 'listener is genuinely bound');
|
|
28
|
+
await new Promise((resolve, reject) => {
|
|
29
|
+
const timeout = setTimeout(() => { socket.off('message', received); reject(new Error('test UDP receive timeout')); }, 1000);
|
|
30
|
+
function received() { clearTimeout(timeout); resolve(); }
|
|
31
|
+
socket.once('message', received);
|
|
32
|
+
sender.send(telegram(powerKw), port, '127.0.0.1', error => { if (error) { clearTimeout(timeout); socket.off('message', received); reject(error); } });
|
|
33
|
+
});
|
|
34
|
+
return driver.readDatapoints(points);
|
|
35
|
+
}
|
|
36
|
+
return { driver, send, reservation, adapter, port, logs };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
test('real UDP listener recovers after an unexpected close instead of serving its old telegram forever', { timeout: 4000 }, async t => {
|
|
40
|
+
const h = await fixture(t);
|
|
41
|
+
await assert.rejects(h.driver.readDatapoints(points), { code: 'E_SPEEDWIRE_NO_DATA' });
|
|
42
|
+
assert.equal((await h.send(1.5)).power, 1.5);
|
|
43
|
+
const previous = h.driver.hub.socket; await close(previous);
|
|
44
|
+
await h.driver._ensureListener();
|
|
45
|
+
assert.notEqual(h.driver.hub.socket, previous);
|
|
46
|
+
assert.equal((await h.send(2.5)).power, 2.5);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('a failed initial UDP bind remains retryable after the occupied port is released', { timeout: 4000 }, async t => {
|
|
50
|
+
const h = await fixture(t, true);
|
|
51
|
+
await assert.rejects(h.driver.readDatapoints(points), { code: 'EADDRINUSE' });
|
|
52
|
+
await close(h.reservation);
|
|
53
|
+
await h.driver._ensureListener();
|
|
54
|
+
assert.equal((await h.send(3.5)).power, 3.5);
|
|
55
|
+
assert.equal(h.driver.hub.handlers.size, 1, 'retry must not duplicate receiver callbacks');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('socket error is followed by a new receiver and stale socket events cannot stop its replacement', { timeout: 4000 }, async t => {
|
|
59
|
+
const h = await fixture(t);
|
|
60
|
+
await h.driver._ensureListener(); await h.send(4);
|
|
61
|
+
const old = h.driver.hub.socket;
|
|
62
|
+
old.emit('error', Object.assign(new Error('fixture transport failure'), { code: 'EIO' }));
|
|
63
|
+
await new Promise(resolve => setImmediate(resolve));
|
|
64
|
+
await h.driver._ensureListener();
|
|
65
|
+
const replacement = h.driver.hub.socket;
|
|
66
|
+
assert.ok(replacement); assert.notEqual(replacement, old);
|
|
67
|
+
old.emit('error', new Error('late old socket event'));
|
|
68
|
+
assert.equal(h.driver.hub.socket, replacement);
|
|
69
|
+
assert.equal((await h.send(5)).power, 5);
|
|
70
|
+
const lastSeen = h.driver.lastSeen;
|
|
71
|
+
old.emit('message', telegram(99), { address: '127.0.0.1' });
|
|
72
|
+
assert.equal((await h.driver.readDatapoints(points)).power, 5, 'old receiver cannot overwrite the replacement sample');
|
|
73
|
+
assert.equal(h.driver.lastSeen, lastSeen, 'old receiver cannot fabricate measurement freshness');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('disconnect during bind and shared-listener handover leave no orphan receiver or lost active subscriber', { timeout: 4000 }, async t => {
|
|
77
|
+
const h = await fixture(t);
|
|
78
|
+
const starting = h.driver._ensureListener(); const hub = h.driver.hub;
|
|
79
|
+
await Promise.all([starting, h.driver.disconnect()]);
|
|
80
|
+
assert.equal(hub.socket, null); assert.equal(hub.handlers.size, 0);
|
|
81
|
+
await h.driver._ensureListener(); await h.send(6);
|
|
82
|
+
const second = new SpeedwireDriver(h.adapter, { id: 'sma2', connection: { port: h.port, multicastGroup: '127.0.0.1', host: '127.0.0.1' } });
|
|
83
|
+
t.after(() => second.disconnect()); await second._ensureListener();
|
|
84
|
+
assert.equal(second.hub, h.driver.hub); assert.equal(second.hub.handlers.size, 2);
|
|
85
|
+
await second.disconnect(); assert.equal(h.driver.hub.handlers.size, 1);
|
|
86
|
+
assert.equal((await h.send(7)).power, 7);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test('one failed-bind subscriber leaving cannot evict the shared hub or split later users across two receivers', { timeout: 4000 }, async t => {
|
|
90
|
+
const h = await fixture(t, true);
|
|
91
|
+
const make = id => new SpeedwireDriver(h.adapter, { id, connection: { port: h.port, multicastGroup: '127.0.0.1', host: '127.0.0.1' } });
|
|
92
|
+
const leaving = make('leaving'); const later = make('later');
|
|
93
|
+
t.after(async () => { await leaving.disconnect(); await later.disconnect(); });
|
|
94
|
+
const failed = await Promise.allSettled([h.driver._ensureListener(), leaving._ensureListener()]);
|
|
95
|
+
assert.ok(failed.every(result => result.status === 'rejected' && result.reason.code === 'EADDRINUSE'));
|
|
96
|
+
const shared = h.driver.hub;
|
|
97
|
+
assert.equal(leaving.hub, shared); assert.equal(shared.handlers.size, 2);
|
|
98
|
+
await leaving.disconnect();
|
|
99
|
+
assert.equal(shared.handlers.size, 1); assert.equal(shared.socket, null);
|
|
100
|
+
await close(h.reservation);
|
|
101
|
+
await h.driver._ensureListener(); await later._ensureListener();
|
|
102
|
+
assert.equal(later.hub, shared, 'the surviving subscriber must retain its registered shared hub');
|
|
103
|
+
assert.equal(shared.handlers.size, 2);
|
|
104
|
+
assert.equal((await h.send(8)).power, 8);
|
|
105
|
+
assert.equal((await later.readDatapoints(points)).power, 8);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('current validation and legacy import preserve all explicit SMA receiver and host-filter settings', async () => {
|
|
109
|
+
const connection = { host: '192.168.10.70', filterHost: '192.168.10.70', port: 9522, multicastGroup: '239.12.255.254',
|
|
110
|
+
interfaceAddress: '192.168.10.153', staleTimeoutMs: 45000, softStale: false, customerOption: 'preserve' };
|
|
111
|
+
const device = { id: 'sma', protocol: 'speedwire', templateId: 'meter.sma.SmaEnergyMeterSpeedwireImpl', enabled: true, connection };
|
|
112
|
+
const config = { enabled: true, devices: [device], pollIntervalMs: 5000 };
|
|
113
|
+
assert.deepEqual(validateConfig(config).devices[0].connection, connection);
|
|
114
|
+
assert.deepEqual((await preflightLegacyConfig({ enabled: true, devices: [], devicesJson: JSON.stringify([device]) })).config.devices[0].connection, connection);
|
|
115
|
+
const defaults = new SpeedwireDriver({}, { connection: {} });
|
|
116
|
+
assert.equal(defaults.port, 9522); assert.equal(defaults.multicastGroup, '239.12.255.254');
|
|
117
|
+
assert.equal(defaults.interfaceAddress, ''); assert.equal(defaults.filterHost, '');
|
|
118
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"checkJs": true,
|
|
5
|
+
"noEmit": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noUncheckedIndexedAccess": true,
|
|
8
|
+
"exactOptionalPropertyTypes": true,
|
|
9
|
+
"target": "ES2022",
|
|
10
|
+
"module": "node16",
|
|
11
|
+
"moduleResolution": "node16",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"types": ["node"]
|
|
15
|
+
},
|
|
16
|
+
"files": ["lib/deviceAliasSemantics.js", "lib/deviceAliasFreshness.js"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true, "checkJs": true, "noEmit": true, "strict": true,
|
|
4
|
+
"noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true,
|
|
5
|
+
"target": "ES2022", "module": "ESNext", "lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
6
|
+
"types": [], "skipLibCheck": true
|
|
7
|
+
},
|
|
8
|
+
"files": ["admin/ems-assignment.js", "admin/ems-assignment.d.ts"]
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"allowJs": true, "checkJs": false, "noEmit": true, "target": "ES2022",
|
|
4
|
-
"module": "node16", "moduleResolution": "node16", "skipLibCheck": true,
|
|
4
|
+
"module": "node16", "moduleResolution": "node16", "resolveJsonModule": true, "skipLibCheck": true,
|
|
5
5
|
"types": ["node"], "strictNullChecks": true, "noImplicitAny": true
|
|
6
6
|
},
|
|
7
7
|
"files": ["index.js", "operation-guard.js", "lib/operationContext.js", "contracts.d.ts"]
|