iobroker.eos-admin 9.0.19 → 9.0.21

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.
Files changed (491) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +4 -4
  2. package/README.md +7 -3
  3. package/START_HIER_9.0.20.md +65 -0
  4. package/adminWww/.vite/manifest.json +39 -39
  5. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +110 -109
  6. package/adminWww/assets/{AdapterUpdateDialog-JOf2z4Vg.js → AdapterUpdateDialog-Dxl_b7Op.js} +1 -1
  7. package/adminWww/assets/{Adapters-C9fcSdWm.js → Adapters-CVKKhXmI.js} +1 -1
  8. package/adminWww/assets/{ConfigManager-BeeLlT6D.js → ConfigManager-Bf6nTAkL.js} +1 -1
  9. package/adminWww/assets/{Enums-FqnXWl8U.js → Enums-CJHVJY7t.js} +1 -1
  10. package/adminWww/assets/{Fields-DMgrt5Pi.js → Fields-DWHbZKvm.js} +1 -1
  11. package/adminWww/assets/{Files-CIHtt12g.js → Files-a6owMTXA.js} +1 -1
  12. package/adminWww/assets/{Hosts-fPLBzvTy.js → Hosts-LtEMeXpV.js} +1 -1
  13. package/adminWww/assets/{Instances-4XaVQlrT.js → Instances-DhChziA1.js} +1 -1
  14. package/adminWww/assets/{Intro-5TKriiLO.js → Intro-Cyq9gVDC.js} +1 -1
  15. package/adminWww/assets/{Logs-33zcIds-.js → Logs-wcramXsg.js} +1 -1
  16. package/adminWww/assets/{Objects-CNQPVbNG.js → Objects-DINVHd_e.js} +1 -1
  17. package/adminWww/assets/{Overview-BskXGOc8.js → Overview-DK4R41zR.js} +1 -1
  18. package/adminWww/assets/{State-C8SJ_Iqo.js → State-DcEACXzL.js} +1 -1
  19. package/adminWww/assets/{UsedResources-CgqRa9ei.js → UsedResources-C1LcM0Rb.js} +1 -1
  20. package/adminWww/assets/{Users-0JVYWR9u.js → Users-DvDdSyDY.js} +1 -1
  21. package/adminWww/assets/{bootstrap-D16lu6rd.js → bootstrap-Dbj_GbnP.js} +3 -3
  22. package/adminWww/assets/{hostInit-C8YZJuzi.js → hostInit-BNFIx0-f.js} +1 -1
  23. package/adminWww/assets/icons/nexowatt-180.png +0 -0
  24. package/adminWww/assets/{icons-material-CiNJ_6Ur.js → icons-material-DVbdXNgr.js} +1 -1
  25. package/adminWww/assets/{index-DA9Sphgh.js → index-CoKP1NSA.js} +2 -2
  26. package/adminWww/assets/{installSVGRenderer-DPdkRa_d.js → installSVGRenderer-CMvku1F1.js} +1 -1
  27. package/adminWww/assets/{mf-entry-bootstrap-0-a7ab91de.js → mf-entry-bootstrap-0-ac330bce.js} +2 -2
  28. package/adminWww/index.html +24 -24
  29. package/adminWww/mf-manifest.json +1 -1
  30. package/adminWww/mf-stats.json +1 -1
  31. package/adminWww/{remoteEntry-eos-9.0.19.js → remoteEntry-eos-9.0.21.js} +1 -1
  32. package/adminWww/remoteEntry.js +1 -1
  33. package/build/lib/eosCustomerUpdateHttp.js +203 -0
  34. package/build/lib/eosCustomerUpdateHttp.js.map +1 -0
  35. package/build/lib/eosCustomerUpdateTransport.js +472 -0
  36. package/build/lib/eosCustomerUpdateTransport.js.map +1 -0
  37. package/build/lib/eosCustomerUpdateWorker.js +567 -0
  38. package/build/lib/eosCustomerUpdateWorker.js.map +1 -0
  39. package/build/lib/eosCustomerUpdates.js +631 -0
  40. package/build/lib/eosCustomerUpdates.js.map +1 -0
  41. package/build/lib/eosDeviceEmsPlan.js +18 -5
  42. package/build/lib/eosDeviceEmsPlan.js.map +1 -1
  43. package/build/lib/eosDeviceEmsService.js +52 -2
  44. package/build/lib/eosDeviceEmsService.js.map +1 -1
  45. package/build/lib/eosLegacyMigration.js +26 -1
  46. package/build/lib/eosLegacyMigration.js.map +1 -1
  47. package/build/lib/eosModuleConfigStore.js +12 -1
  48. package/build/lib/eosModuleConfigStore.js.map +1 -1
  49. package/build/lib/eosModuleHost.js +81 -26
  50. package/build/lib/eosModuleHost.js.map +1 -1
  51. package/build/lib/eosModuleHttp.js +8 -2
  52. package/build/lib/eosModuleHttp.js.map +1 -1
  53. package/build/lib/eosStateSubscriptions.js +59 -2
  54. package/build/lib/eosStateSubscriptions.js.map +1 -1
  55. package/build/lib/eosUpdateSnapshot.js +290 -0
  56. package/build/lib/eosUpdateSnapshot.js.map +1 -0
  57. package/build/lib/eosUploadGuard.js +124 -81
  58. package/build/lib/eosUploadGuard.js.map +1 -1
  59. package/build/lib/web.js +83 -0
  60. package/build/lib/web.js.map +1 -1
  61. package/docs/reports/unified-9.0.20/ANFORDERUNGEN_UND_INBETRIEBNAHME.md +159 -0
  62. package/docs/reports/unified-9.0.20/DEVICE_COMMAND_DELIVERY_REVIEW.md +82 -0
  63. package/docs/reports/unified-9.0.20/DEVICE_LIFECYCLE_REVIEW.md +46 -0
  64. package/docs/reports/unified-9.0.20/DEVICE_PLAN_REVIEW.md +33 -0
  65. package/docs/reports/unified-9.0.20/DEVICE_POWER_CAPABILITY_REVIEW.md +25 -0
  66. package/docs/reports/unified-9.0.20/FARM_CONTROLLER_REVIEW.md +27 -0
  67. package/docs/reports/unified-9.0.20/FARM_DIAGNOSE_UI.md +81 -0
  68. package/docs/reports/unified-9.0.20/FARM_DISPATCH_REVIEW.md +47 -0
  69. package/docs/reports/unified-9.0.20/HISTORY_REVIEW.md +68 -0
  70. package/docs/reports/unified-9.0.20/INFLUXDB2_INSTALLER_UI.md +39 -0
  71. package/docs/reports/unified-9.0.20/INFLUX_CREDENTIAL_NETWORK_REVIEW.md +38 -0
  72. package/docs/reports/unified-9.0.20/INFLUX_DIRECT_UNABHAENGIGE_PRUEFUNG.md +64 -0
  73. package/docs/reports/unified-9.0.20/INFLUX_RUNTIME_INTEGRATION_REVIEW.md +53 -0
  74. package/docs/reports/unified-9.0.20/INFLUX_RUNTIME_UNABHAENGIGE_PRUEFUNG.md +34 -0
  75. package/docs/reports/unified-9.0.20/INFLUX_TRANSPORT_ABSCHLUSSPRUEFUNG.md +55 -0
  76. package/docs/reports/unified-9.0.20/LOGIN_WEBAPP_LOGO.md +29 -0
  77. package/docs/reports/unified-9.0.20/MIGRATION_REVIEW.md +35 -0
  78. package/docs/reports/unified-9.0.20/PRUEFBERICHT.md +54 -0
  79. package/docs/reports/unified-9.0.20/PWA_ANONYMOUS_HTTPS_REVIEW.md +28 -0
  80. package/docs/reports/unified-9.0.20/PWA_ICON_UNABHAENGIGE_PRUEFUNG.md +60 -0
  81. package/docs/reports/unified-9.0.20/SERIAL_LIFECYCLE_REVIEW.md +37 -0
  82. package/docs/reports/unified-9.0.20/SOLAX_READBACK_REVIEW.md +43 -0
  83. package/docs/reports/unified-9.0.20/SOLAX_READBACK_UNABHAENGIGE_PRUEFUNG.md +34 -0
  84. package/docs/reports/unified-9.0.20/STATIC_REVIEW_DE.md +175 -0
  85. package/docs/reports/unified-9.0.20/STORAGE_COMMAND_ACK_REVIEW.md +36 -0
  86. package/docs/reports/unified-9.0.20/TARIFF_REPORT_REVIEW.md +29 -0
  87. package/docs/reports/unified-9.0.20/VISUALISIERUNG.md +64 -0
  88. package/docs/reports/unified-9.0.20/history-setup-navigation-proxy.txt +26 -0
  89. package/docs/reports/unified-9.0.20/history-setup-navigation-ssr.txt +7 -0
  90. package/docs/reports/unified-9.0.20/history-setup-ui-lint.txt +0 -0
  91. package/docs/reports/unified-9.0.20/history-setup-ui-node22.txt +102 -0
  92. package/docs/reports/unified-9.0.20/history-setup-ui-node24.txt +23 -0
  93. package/docs/reports/unified-9.0.20/history-setup-ui-security.txt +0 -0
  94. package/docs/reports/unified-9.0.20/history-setup-ui-typecheck.txt +0 -0
  95. package/docs/reports/unified-9.0.20/login-pwa-branding-hashes.txt +9 -0
  96. package/docs/reports/unified-9.0.20/login-pwa-branding-node22.txt +42 -0
  97. package/docs/reports/unified-9.0.20/login-pwa-branding-node24.txt +13 -0
  98. package/docs/reports/unified-9.0.20/raw/INDEX.json +1913 -0
  99. package/docs/reports/unified-9.0.20/raw/additional-audit/device/baseline-node22.log +16 -0
  100. package/docs/reports/unified-9.0.20/raw/additional-audit/device/baseline-node24.log +14 -0
  101. package/docs/reports/unified-9.0.20/raw/additional-audit/device/lint-after.json +1 -0
  102. package/docs/reports/unified-9.0.20/raw/additional-audit/device/lint-before.json +1 -0
  103. package/docs/reports/unified-9.0.20/raw/additional-audit/device/modbus-stop-backoff.cjs +22 -0
  104. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-control-review.log +29 -0
  105. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-final.json +18 -0
  106. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-final.log +325 -0
  107. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-review.log +278 -0
  108. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-final.json +18 -0
  109. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-final.log +58 -0
  110. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-review.log +51 -0
  111. package/docs/reports/unified-9.0.20/raw/additional-audit/history/api-gaps-before.log +64 -0
  112. package/docs/reports/unified-9.0.20/raw/additional-audit/history/api-negative-before.log +46 -0
  113. package/docs/reports/unified-9.0.20/raw/additional-audit/history/chart-gaps-before.log +127 -0
  114. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-after.log +67 -0
  115. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-before.log +61 -0
  116. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-eslint-js.log +0 -0
  117. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-eslint-ts.log +0 -0
  118. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-node22.log +442 -0
  119. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-node24.log +78 -0
  120. package/docs/reports/unified-9.0.20/raw/additional-audit/history/fix.py +73 -0
  121. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-eslint-final.json +7 -0
  122. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-final-node22.log +279 -0
  123. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-final-node24.log +52 -0
  124. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-followup-node22.log +223 -0
  125. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-followup-node24.log +43 -0
  126. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-own-cache.log +17 -0
  127. package/docs/reports/unified-9.0.20/raw/additional-audit/history/negative-pricing-before.log +96 -0
  128. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node22-after.log +66 -0
  129. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node22-repro.log +8 -0
  130. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node24-after.log +17 -0
  131. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node24-repro.log +8 -0
  132. package/docs/reports/unified-9.0.20/raw/additional-audit/history/repro.cjs +39 -0
  133. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/chromium-probe.log +3 -0
  134. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/patch-live.py +101 -0
  135. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/repro-live-display.cjs +26 -0
  136. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/repro-live-display.log +36 -0
  137. package/docs/reports/unified-9.0.20/raw/audit-full.log +345 -0
  138. package/docs/reports/unified-9.0.20/raw/audit-full.result.json +14 -0
  139. package/docs/reports/unified-9.0.20/raw/audit-runtime.log +23 -0
  140. package/docs/reports/unified-9.0.20/raw/audit-runtime.result.json +15 -0
  141. package/docs/reports/unified-9.0.20/raw/backend-final.log +5 -0
  142. package/docs/reports/unified-9.0.20/raw/backend-final.result.json +14 -0
  143. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node22.result.json +20 -0
  144. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node22.tap +721 -0
  145. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node24.result.json +20 -0
  146. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node24.tap +127 -0
  147. package/docs/reports/unified-9.0.20/raw/commissioning-evidence.json +69 -0
  148. package/docs/reports/unified-9.0.20/raw/commissioning-failed-init-drain-919-before.log +14 -0
  149. package/docs/reports/unified-9.0.20/raw/commissioning-final-node22.log +882 -0
  150. package/docs/reports/unified-9.0.20/raw/commissioning-final-node24.log +149 -0
  151. package/docs/reports/unified-9.0.20/raw/commissioning-lint.log +0 -0
  152. package/docs/reports/unified-9.0.20/raw/commissioning-planner-919-before.log +70 -0
  153. package/docs/reports/unified-9.0.20/raw/commissioning-retained-readiness-before.log +34 -0
  154. package/docs/reports/unified-9.0.20/raw/commissioning-runtime-retry-919-before.log +46 -0
  155. package/docs/reports/unified-9.0.20/raw/commissioning-types-node24.log +0 -0
  156. package/docs/reports/unified-9.0.20/raw/device-farm-protocol/DEVICE_FARM_READONLY_REVIEW.md +66 -0
  157. package/docs/reports/unified-9.0.20/raw/device-farm-protocol/run-readback-tests.cjs +13 -0
  158. package/docs/reports/unified-9.0.20/raw/device-farm-protocol/solax-control-chain.test.cjs +58 -0
  159. package/docs/reports/unified-9.0.20/raw/device-lifecycle-baseline-node22.log +16 -0
  160. package/docs/reports/unified-9.0.20/raw/device-lifecycle-baseline-node24.log +14 -0
  161. package/docs/reports/unified-9.0.20/raw/device-lifecycle-evidence.json +55 -0
  162. package/docs/reports/unified-9.0.20/raw/device-lifecycle-lint-after.json +1 -0
  163. package/docs/reports/unified-9.0.20/raw/device-lifecycle-lint-before.json +1 -0
  164. package/docs/reports/unified-9.0.20/raw/device-lifecycle-modbus-stop-backoff.cjs +22 -0
  165. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-control-review.log +29 -0
  166. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-final.json +18 -0
  167. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-final.log +325 -0
  168. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-review.log +278 -0
  169. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-final.json +18 -0
  170. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-final.log +58 -0
  171. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-review.log +51 -0
  172. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node22.log +0 -0
  173. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node22.result.json +15 -0
  174. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node24.log +0 -0
  175. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node24.result.json +15 -0
  176. package/docs/reports/unified-9.0.20/raw/farm-controller/controller-node22.log +110 -0
  177. package/docs/reports/unified-9.0.20/raw/farm-controller/controller-node24.log +24 -0
  178. package/docs/reports/unified-9.0.20/raw/farm-controller/evidence.json +33 -0
  179. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-lint.txt +0 -0
  180. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-node22.txt +113 -0
  181. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-node24.txt +26 -0
  182. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-security.txt +0 -0
  183. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-typecheck.txt +0 -0
  184. package/docs/reports/unified-9.0.20/raw/farm-dispatch/allocator-baseline.jsonl +6 -0
  185. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-before.log +138 -0
  186. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-main-delta.patch +77 -0
  187. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-main-lint.json +7 -0
  188. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node22.log +64 -0
  189. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node22.result.json +14 -0
  190. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node24.log +18 -0
  191. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node24.result.json +14 -0
  192. package/docs/reports/unified-9.0.20/raw/final-ui-independent-review.json +194 -0
  193. package/docs/reports/unified-9.0.20/raw/frontend-build.log +152 -0
  194. package/docs/reports/unified-9.0.20/raw/frontend-build.result.json +14 -0
  195. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node22.json +35 -0
  196. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node22.result.json +17 -0
  197. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node24.json +31 -0
  198. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node24.result.json +17 -0
  199. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-before.json +31 -0
  200. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-reproducer.cjs +9 -0
  201. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node22.result.json +18 -0
  202. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node22.tap +34 -0
  203. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node24.result.json +18 -0
  204. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node24.tap +11 -0
  205. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra.test.cjs +9 -0
  206. package/docs/reports/unified-9.0.20/raw/independent-solax/node22-focused.log +165 -0
  207. package/docs/reports/unified-9.0.20/raw/independent-solax/node24-focused.log +35 -0
  208. package/docs/reports/unified-9.0.20/raw/independent-solax/review-receipt.json +57 -0
  209. package/docs/reports/unified-9.0.20/raw/independent-solax/split-response-after.log +1 -0
  210. package/docs/reports/unified-9.0.20/raw/independent-solax/split-response-before.log +1 -0
  211. package/docs/reports/unified-9.0.20/raw/independent-solax/split-response.cjs +16 -0
  212. package/docs/reports/unified-9.0.20/raw/independent-solax/stop-race-generation-guard.log +1 -0
  213. package/docs/reports/unified-9.0.20/raw/independent-solax/stop-race.cjs +13 -0
  214. package/docs/reports/unified-9.0.20/raw/influx-direct/eslint.log +0 -0
  215. package/docs/reports/unified-9.0.20/raw/influx-direct/node22.log +112 -0
  216. package/docs/reports/unified-9.0.20/raw/influx-direct/node24.log +24 -0
  217. package/docs/reports/unified-9.0.20/raw/influx-direct/typecheck.log +0 -0
  218. package/docs/reports/unified-9.0.20/raw/influx-direct-review/hosted-module-history.test.cjs +85 -0
  219. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node22.json +12 -0
  220. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node22.log +100 -0
  221. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node24.json +12 -0
  222. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node24.log +21 -0
  223. package/docs/reports/unified-9.0.20/raw/influx-direct-review/runtime-after.test.cjs +15 -0
  224. package/docs/reports/unified-9.0.20/raw/influx-direct-review/runtime-loss-before.test.cjs +9 -0
  225. package/docs/reports/unified-9.0.20/raw/influx-direct-review/security-scan.cjs +15 -0
  226. package/docs/reports/unified-9.0.20/raw/influx-direct-review/transport-extra.test.cjs +9 -0
  227. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node22.log +227 -0
  228. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node22.result.json +11 -0
  229. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node24.log +44 -0
  230. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node24.result.json +11 -0
  231. package/docs/reports/unified-9.0.20/raw/influx-independent/node22.log +112 -0
  232. package/docs/reports/unified-9.0.20/raw/influx-independent/node22.result.json +12 -0
  233. package/docs/reports/unified-9.0.20/raw/influx-independent/node24.log +23 -0
  234. package/docs/reports/unified-9.0.20/raw/influx-independent/node24.result.json +12 -0
  235. package/docs/reports/unified-9.0.20/raw/influx-independent/runtime-after.test.cjs +15 -0
  236. package/docs/reports/unified-9.0.20/raw/influx-independent/transport-extra.test.cjs +9 -0
  237. package/docs/reports/unified-9.0.20/raw/influx-runtime/evidence.json +24 -0
  238. package/docs/reports/unified-9.0.20/raw/influx-runtime/final-node22.log +326 -0
  239. package/docs/reports/unified-9.0.20/raw/influx-runtime/final-node24.log +59 -0
  240. package/docs/reports/unified-9.0.20/raw/influx-runtime/runtime-node22.log +62 -0
  241. package/docs/reports/unified-9.0.20/raw/influx-runtime/runtime-node24.log +16 -0
  242. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-lint.log +0 -0
  243. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-lint.result.json +17 -0
  244. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node22.log +112 -0
  245. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node22.result.json +15 -0
  246. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node24.log +106 -0
  247. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node24.result.json +15 -0
  248. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-typecheck.log +0 -0
  249. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-typecheck.result.json +15 -0
  250. package/docs/reports/unified-9.0.20/raw/influx-security/source-sha256.json +5 -0
  251. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-lint-final.log +0 -0
  252. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-lint-final.result.json +16 -0
  253. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node22-final.log +124 -0
  254. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node22-final.result.json +14 -0
  255. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node24-final.log +26 -0
  256. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node24-final.result.json +14 -0
  257. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node22-final.log +0 -0
  258. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node22-final.result.json +15 -0
  259. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node24-final.log +0 -0
  260. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node24-final.result.json +15 -0
  261. package/docs/reports/unified-9.0.20/raw/influx-ui-independent-review-final.json +285 -0
  262. package/docs/reports/unified-9.0.20/raw/influx-ui-independent-review-intermediate.json +285 -0
  263. package/docs/reports/unified-9.0.20/raw/installer-build.log +26 -0
  264. package/docs/reports/unified-9.0.20/raw/installer-build.result.json +14 -0
  265. package/docs/reports/unified-9.0.20/raw/isolation/INDEX.json +332 -0
  266. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-final.log +3 -0
  267. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-final.result.json +13 -0
  268. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-hosted.log +6 -0
  269. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-hosted.result.json +13 -0
  270. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-verified.log +1 -0
  271. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-verified.result.json +13 -0
  272. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family.log +11 -0
  273. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family.result.json +13 -0
  274. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-final.log +3 -0
  275. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-final.result.json +13 -0
  276. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-hosted.log +3 -0
  277. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-hosted.result.json +13 -0
  278. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-verified.log +1 -0
  279. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-verified.result.json +13 -0
  280. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid.log +11 -0
  281. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid.result.json +13 -0
  282. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node22.log +296 -0
  283. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node22.result.json +16 -0
  284. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node24.log +56 -0
  285. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node24.result.json +16 -0
  286. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-node24.log +54 -0
  287. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-node24.result.json +16 -0
  288. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-output-modes.log +1 -0
  289. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-output-modes.result.json +13 -0
  290. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node22.log +332 -0
  291. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node22.result.json +16 -0
  292. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node24.log +62 -0
  293. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node24.result.json +16 -0
  294. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node22.log +342 -0
  295. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node22.result.json +16 -0
  296. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node24.log +72 -0
  297. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node24.result.json +16 -0
  298. package/docs/reports/unified-9.0.20/raw/isolation/isolation-node22.log +482 -0
  299. package/docs/reports/unified-9.0.20/raw/isolation/isolation-node22.result.json +19 -0
  300. package/docs/reports/unified-9.0.20/raw/isolation/isolation-node24.log +87 -0
  301. package/docs/reports/unified-9.0.20/raw/isolation/migration-lint.log +0 -0
  302. package/docs/reports/unified-9.0.20/raw/isolation/migration-lint.result.json +16 -0
  303. package/docs/reports/unified-9.0.20/raw/isolation/migration-node22.log +330 -0
  304. package/docs/reports/unified-9.0.20/raw/isolation/migration-node22.result.json +16 -0
  305. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24-before.log +72 -0
  306. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24-before.result.json +16 -0
  307. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24.log +60 -0
  308. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24.result.json +16 -0
  309. package/docs/reports/unified-9.0.20/raw/isolation/repro-migration-start-budget.cjs +49 -0
  310. package/docs/reports/unified-9.0.20/raw/isolation/repro-serial-release.cjs +21 -0
  311. package/docs/reports/unified-9.0.20/raw/isolation/repro-sunspec-discovery.cjs +11 -0
  312. package/docs/reports/unified-9.0.20/raw/isolation/serial-before-repro.log +1 -0
  313. package/docs/reports/unified-9.0.20/raw/isolation/serial-before-repro.result.json +13 -0
  314. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node22.log +32 -0
  315. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node22.result.json +14 -0
  316. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node24.log +11 -0
  317. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node24.result.json +14 -0
  318. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck-final.log +0 -0
  319. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck-final.result.json +28 -0
  320. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck.log +2 -0
  321. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck.result.json +26 -0
  322. package/docs/reports/unified-9.0.20/raw/isolation/serial-lint.log +0 -0
  323. package/docs/reports/unified-9.0.20/raw/isolation/serial-lint.result.json +18 -0
  324. package/docs/reports/unified-9.0.20/raw/isolation/serial-node22.log +344 -0
  325. package/docs/reports/unified-9.0.20/raw/isolation/serial-node22.result.json +17 -0
  326. package/docs/reports/unified-9.0.20/raw/isolation/serial-node24.log +62 -0
  327. package/docs/reports/unified-9.0.20/raw/isolation/serial-node24.result.json +17 -0
  328. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-after.log +3 -0
  329. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-after.result.json +13 -0
  330. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-before.log +3 -0
  331. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-before.result.json +15 -0
  332. package/docs/reports/unified-9.0.20/raw/keygen-source.json +6 -0
  333. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/check-919.log +70 -0
  334. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/check-920.log +71 -0
  335. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/diff.json +82 -0
  336. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/receipt.json +48 -0
  337. package/docs/reports/unified-9.0.20/raw/lint-final.log +16 -0
  338. package/docs/reports/unified-9.0.20/raw/lint-final.result.json +14 -0
  339. package/docs/reports/unified-9.0.20/raw/main-individual-review-before-cache-boundary-fix.json +112 -0
  340. package/docs/reports/unified-9.0.20/raw/main-individual-review-before-capability-ack.json +103 -0
  341. package/docs/reports/unified-9.0.20/raw/main-individual-review-before-farm-diagnostics.json +102 -0
  342. package/docs/reports/unified-9.0.20/raw/main-individual-review-final.json +103 -0
  343. package/docs/reports/unified-9.0.20/raw/main-individual-review.json +93 -0
  344. package/docs/reports/unified-9.0.20/raw/modules-build.log +5 -0
  345. package/docs/reports/unified-9.0.20/raw/modules-build.result.json +14 -0
  346. package/docs/reports/unified-9.0.20/raw/node22-tests-final.log +12471 -0
  347. package/docs/reports/unified-9.0.20/raw/node22-tests-final.result.json +13 -0
  348. package/docs/reports/unified-9.0.20/raw/node22-typecheck-final.log +7 -0
  349. package/docs/reports/unified-9.0.20/raw/node22-typecheck-final.result.json +14 -0
  350. package/docs/reports/unified-9.0.20/raw/node22-version.log +1 -0
  351. package/docs/reports/unified-9.0.20/raw/node24-tests-final.log +2093 -0
  352. package/docs/reports/unified-9.0.20/raw/node24-tests-final.result.json +13 -0
  353. package/docs/reports/unified-9.0.20/raw/node24-typecheck-final.log +5 -0
  354. package/docs/reports/unified-9.0.20/raw/node24-typecheck-final.result.json +14 -0
  355. package/docs/reports/unified-9.0.20/raw/node24-version.log +1 -0
  356. package/docs/reports/unified-9.0.20/raw/power-capability/evidence.json +69 -0
  357. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-existing-regressions-node24.log +94 -0
  358. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-lint.log +0 -0
  359. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-node22.log +304 -0
  360. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-node24.log +56 -0
  361. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-typecheck.log +0 -0
  362. package/docs/reports/unified-9.0.20/raw/pwa-https/evidence.json +45 -0
  363. package/docs/reports/unified-9.0.20/raw/pwa-https/node22-build.log +21 -0
  364. package/docs/reports/unified-9.0.20/raw/pwa-https/node22-source.log +23 -0
  365. package/docs/reports/unified-9.0.20/raw/pwa-https/node24-build.log +11 -0
  366. package/docs/reports/unified-9.0.20/raw/pwa-https/node24-source.log +11 -0
  367. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-boundaries.test.cjs +45 -0
  368. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-receipt.json +71 -0
  369. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-v22.23.4.tap +34 -0
  370. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-v24.22.3.tap +11 -0
  371. package/docs/reports/unified-9.0.20/raw/pwa-ui-independent-review-final.json +348 -0
  372. package/docs/reports/unified-9.0.20/raw/repro-failed-init-drain-before.cjs +15 -0
  373. package/docs/reports/unified-9.0.20/raw/repro-profile-replacement-after-unmapped.cjs +15 -0
  374. package/docs/reports/unified-9.0.20/raw/repro-runtime-retry-before.cjs +18 -0
  375. package/docs/reports/unified-9.0.20/raw/sbom-runtime.log +7 -0
  376. package/docs/reports/unified-9.0.20/raw/sbom-runtime.result.json +14 -0
  377. package/docs/reports/unified-9.0.20/raw/sbom-vendor-check.log +1 -0
  378. package/docs/reports/unified-9.0.20/raw/sbom-vendor-check.result.json +14 -0
  379. package/docs/reports/unified-9.0.20/raw/solax-readback-node22.json +30 -0
  380. package/docs/reports/unified-9.0.20/raw/solax-readback-node22.log +542 -0
  381. package/docs/reports/unified-9.0.20/raw/solax-readback-node24.json +30 -0
  382. package/docs/reports/unified-9.0.20/raw/solax-readback-node24.log +97 -0
  383. package/docs/reports/unified-9.0.20/raw/tariff-report-before.log +147 -0
  384. package/docs/reports/unified-9.0.20/raw/tariff-report-evidence.json +48 -0
  385. package/docs/reports/unified-9.0.20/raw/tariff-report-final-node22.log +151 -0
  386. package/docs/reports/unified-9.0.20/raw/tariff-report-final-node24.log +32 -0
  387. package/docs/reports/unified-9.0.20/raw/ui-docs-check.log +6 -0
  388. package/docs/reports/unified-9.0.20/raw/ui-docs-check.result.json +14 -0
  389. package/docs/reports/unified-9.0.20/raw/ui-runtime-final.log +7 -0
  390. package/docs/reports/unified-9.0.20/raw/ui-runtime-final.result.json +14 -0
  391. package/docs/reports/unified-9.0.20/raw/ui-runtime-sync.log +6 -0
  392. package/docs/reports/unified-9.0.20/raw/ui-runtime-sync.result.json +14 -0
  393. package/docs/reports/unified-9.0.20/raw/ui-sbom-check.log +6 -0
  394. package/docs/reports/unified-9.0.20/raw/ui-sbom-check.result.json +14 -0
  395. package/docs/reports/unified-9.0.20/raw/ui-sbom-final.log +6 -0
  396. package/docs/reports/unified-9.0.20/raw/ui-sbom-final.result.json +14 -0
  397. package/docs/reports/unified-9.0.20/raw/ui-secret-final.log +6 -0
  398. package/docs/reports/unified-9.0.20/raw/ui-secret-final.result.json +14 -0
  399. package/docs/reports/unified-9.0.20/raw/ui-security-final.log +8 -0
  400. package/docs/reports/unified-9.0.20/raw/ui-security-final.result.json +14 -0
  401. package/docs/reports/unified-9.0.20/raw/visuals-baseline-919.txt +36 -0
  402. package/docs/reports/unified-9.0.20/raw/visuals-browser-limit.txt +3 -0
  403. package/docs/reports/unified-9.0.20/raw/visuals-lint.txt +0 -0
  404. package/docs/reports/unified-9.0.20/raw/visuals-node22.txt +258 -0
  405. package/docs/reports/unified-9.0.20/raw/visuals-node24.txt +51 -0
  406. package/docs/reports/unified-9.0.20/raw/visuals-security.txt +0 -0
  407. package/docs/reports/unified-9.0.20/raw/visuals-typecheck.txt +0 -0
  408. package/docs/reports/unified-9.0.20/raw/wallet-freshness-after.log +19 -0
  409. package/docs/reports/unified-9.0.20/raw/wallet-freshness-after.result.json +16 -0
  410. package/docs/reports/unified-9.0.20/raw/wallet-freshness-before.log +31 -0
  411. package/docs/reports/unified-9.0.20/raw/wallet-freshness-before.result.json +14 -0
  412. package/docs/reports/unified-9.0.20/raw/wallet-freshness-independent.result.json +13 -0
  413. package/docs/reports/unified-9.0.20/raw/wallet-freshness-independent.tap +10 -0
  414. package/io-package.json +12 -12
  415. package/modules/backup/admin/index.js +4 -1
  416. package/modules/devices/admin/host-bridge.js +5 -1
  417. package/modules/devices/lib/device-alias-semantics-v1.json +22 -1
  418. package/modules/devices/lib/deviceAliasFreshness.js +1 -0
  419. package/modules/devices/lib/deviceAliasSemantics.js +13 -3
  420. package/modules/devices/lib/deviceRuntime.js +106 -12
  421. package/modules/devices/lib/drivers/modbus.js +90 -21
  422. package/modules/devices/lib/drivers/modbusAsciiBus.js +47 -31
  423. package/modules/devices/lib/drivers/modbusRtuBus.js +33 -9
  424. package/modules/devices/lib/drivers/modbusSerialLease.js +29 -0
  425. package/modules/devices/lib/drivers/mqtt.js +204 -82
  426. package/modules/devices/lib/drivers/mqttPendingOperations.js +119 -0
  427. package/modules/devices/lib/modbusReadEvidence.js +29 -0
  428. package/modules/devices/test/deviceAliasFreshness.test.js +7 -2
  429. package/modules/devices/test/modbusConnectLifecycle.test.js +148 -0
  430. package/modules/devices/test/modbusSerialLifecycle.test.js +91 -0
  431. package/modules/devices/test/mqttCommandLifecycle.test.js +255 -0
  432. package/modules/devices/test/mqttResourceBounds.test.js +98 -0
  433. package/modules/devices/test/mqttRuntimeSession.test.js +109 -0
  434. package/modules/devices/test/serialOperationGate.test.js +3 -3
  435. package/modules/devices/test/solaxReadbackContext.test.js +472 -0
  436. package/modules/devices/tsconfig.alias-semantics.json +1 -1
  437. package/modules/devices/tsconfig.mqtt-lifecycle.json +20 -0
  438. package/modules/devices/tsconfig.serial-lifecycle.json +18 -0
  439. package/modules/eebus/admin/index.js +6 -3
  440. package/package.json +9 -7
  441. package/release-manifests/unified/build-environment.cdx.json +6 -6
  442. package/release-manifests/unified/files.json +848 -169
  443. package/release-manifests/unified/frontend.cdx.json +6 -6
  444. package/release-manifests/unified/installer.cdx.json +6 -6
  445. package/release-manifests/unified/obsolete-admin-assets.json +154 -6
  446. package/release-manifests/unified/runtime.cdx.json +25 -25
  447. package/release-manifests/unified/validation.json +15 -15
  448. package/tools/eos-release-check.cjs +2 -2
  449. package/tools/eos-release-manifest.cjs +3 -3
  450. package/ui/admin/react/assets/index-BJO3q7oe.js +13 -0
  451. package/ui/admin/react/assets/{index-CuquHlsY.css → index-ofLP_Y7y.css} +1 -1
  452. package/ui/admin/react/index.html +2 -2
  453. package/ui/docs/security/eslint-reviewed-findings.json +91 -35
  454. package/ui/ems/engine.js +14 -3
  455. package/ui/ems/modules/energy-wallet.js +9 -3
  456. package/ui/ems/modules/storage-control.js +60 -19
  457. package/ui/ems/modules/tariff-provider.js +34 -10
  458. package/ui/ems/services/tariff-provider-registry.js +18 -8
  459. package/ui/io-package.json +1 -1
  460. package/ui/lib/influx-config.js +204 -0
  461. package/ui/lib/influx-direct.js +527 -0
  462. package/ui/lib/influx-history-runtime.js +326 -0
  463. package/ui/lib/influx-network-policy.js +112 -0
  464. package/ui/lib/ui-access-policy.js +2 -2
  465. package/ui/main.js +614 -255
  466. package/ui/package.json +12 -6
  467. package/ui/www/app.js +152 -203
  468. package/ui/www/ems-apps.html +2 -1
  469. package/ui/www/ems-apps.js +8 -1
  470. package/ui/www/energy-ledger.html +1 -1
  471. package/ui/www/eos-updates.css +15 -0
  472. package/ui/www/eos-updates.js +351 -0
  473. package/ui/www/evcs.html +1 -1
  474. package/ui/www/history.html +1 -1
  475. package/ui/www/history.js +114 -74
  476. package/ui/www/index.html +4 -1
  477. package/ui/www/live-display.js +115 -0
  478. package/ui/www/logic.html +1 -1
  479. package/ui/www/login.css +1 -0
  480. package/ui/www/login.html +2 -1
  481. package/ui/www/manifest.webmanifest +3 -3
  482. package/ui/www/settings.html +36 -1
  483. package/ui/www/simulation.html +1 -1
  484. package/ui/www/smarthome-config.html +1 -1
  485. package/ui/www/smarthome.html +1 -1
  486. package/ui/www/storagefarm-dispatch.js +287 -0
  487. package/ui/www/storagefarm-summary.css +15 -0
  488. package/ui/www/storagefarm.html +15 -1
  489. package/ui/www/storagefarm.js +8 -26
  490. package/ui/www/tariff-report.js +43 -25
  491. package/ui/admin/react/assets/index-Bq5IupDw.js +0 -13
@@ -0,0 +1,109 @@
1
+ 'use strict';
2
+ /** Independent review regression: actual DeviceRuntime callbacks and queue;
3
+ * database completion and driver transport shutdown are controlled fixtures. */
4
+ const test = require('node:test');
5
+ const assert = require('node:assert/strict');
6
+ const path = require('node:path');
7
+ const { createRequire } = require('node:module');
8
+ const root = path.resolve(__dirname, '../../..');
9
+ const req = createRequire(path.join(process.env.EOS_MQTT_RUNTIME_ROOT || root, 'package.json'));
10
+ const { DeviceRuntime } = req('./modules/devices/lib/deviceRuntime');
11
+ const { MqttCallbackQueue, runMqttMessageSession } = require('../lib/drivers/mqttPendingOperations');
12
+ const template = req('./modules/devices/lib/templates.json').templates.find(row => row.id === 'ess.tesvolt.iotGateway.mqttV2');
13
+ const deferred = () => { let resolve; const promise = new Promise(done => { resolve = done; }); return { promise, resolve }; };
14
+
15
+ function fixture() {
16
+ const held = deferred(); const entered = deferred(); const writes = [];
17
+ let first = true; let current = true;
18
+ const adapter = { log: { debug() {}, info() {}, warn() {}, error() {} }, async setStateAsync(id, state) {
19
+ if (id.endsWith('.info.connection') && state.val === true && first) {
20
+ first = false; entered.resolve(); await held.promise;
21
+ }
22
+ writes.push({ id, ...state });
23
+ } };
24
+ const runtime = new DeviceRuntime(adapter, { id: 'session-review', category: template.category, protocol: 'mqtt', connection: {} }, template, {});
25
+ for (const dp of template.datapoints) runtime.dpById.set(dp.id, dp);
26
+ runtime.aliasDefs = runtime._buildAliasDefinitions();
27
+ return { runtime, writes, held, entered, current: () => current, invalidate: () => { current = false; },
28
+ last: suffix => writes.findLast(row => row.id.endsWith(suffix))?.val };
29
+ }
30
+
31
+ for (const reconnect of [false, true]) test(`old MQTT callback cannot publish aliases beyond offline${reconnect ? ' and a following connection' : ''}`, { timeout: 2000 }, async t => {
32
+ const f = fixture(); t.after(() => f.held.resolve());
33
+ const old = runMqttMessageSession(f.current, () => f.runtime._handleMqttSnapshot({ aCTIVE_POWER: 12, bATTERY_SOC: 80 }, { connected: true }));
34
+ const oldResult = old.then(() => 'completed', error => error.message);
35
+ await f.entered.promise; f.invalidate();
36
+ let offlineFinished = false;
37
+ const offline = f.runtime._handleMqttConnectionState(false, 'test disconnect').then(() => { offlineFinished = true; });
38
+ const newConnection = reconnect ? f.runtime._handleMqttConnectionState(true, '') : Promise.resolve();
39
+ await new Promise(resolve => setImmediate(resolve));
40
+ const offlineFinishedBeforeOldWrite = offlineFinished;
41
+ f.held.resolve();
42
+ const result = await oldResult; await Promise.all([offline, newConnection]);
43
+ assert.equal(offlineFinishedBeforeOldWrite, false, 'offline completion must wait for already-submitted old DB write');
44
+ assert.equal(result, 'E_MQTT_MESSAGE_SESSION_ENDED');
45
+ assert.equal(f.last('.info.connection'), reconnect);
46
+ assert.equal(f.last('.aliases.v1.comm.connected'), reconnect);
47
+ assert.equal(f.writes.some(row => row.id.endsWith('.aliases.v1.r.power') && row.val === 12), false);
48
+ assert.equal(f.writes.some(row => row.id.endsWith('.aliases.v1.r.soc') && row.val === 80), false);
49
+ assert.equal(f.runtime._mqttCallbacks.pendingCount, 0);
50
+ });
51
+
52
+ test('nested offline callback can publish diagnostic aliases without a FIFO deadlock', { timeout: 2000 }, async () => {
53
+ const f = fixture();
54
+ f.runtime.driver = { handleOffline: async () => f.runtime._handleMqttSnapshot({}, { connected: false, diagnosticsOnly: true }) };
55
+ await f.runtime._handleMqttConnectionState(false, 'test nested offline');
56
+ await f.runtime._mqttCallbacks.drain();
57
+ assert.equal(f.last('.aliases.v1.comm.connected'), false);
58
+ assert.equal(f.runtime._mqttCallbacks.pendingCount, 0);
59
+ });
60
+
61
+ test('telemetry backlog is bounded while the final offline barrier remains ordered and observable', { timeout: 2000 }, async t => {
62
+ const queue = new MqttCallbackQueue(); const held = deferred(); const order = [];
63
+ t.after(() => held.resolve());
64
+ const actions = [queue.run(async () => { await held.promise; order.push('first'); })];
65
+ for (let i = 1; i < 32; i++) actions.push(queue.run(async () => { order.push(i); }));
66
+ await assert.rejects(queue.run(async () => { order.push('overflow'); }), /E_MQTT_CALLBACK_BACKLOG/);
67
+ const offline = queue.run(async () => { order.push('offline'); }, 'barrier');
68
+ assert.equal(queue.pendingCount, 33);
69
+ held.resolve(); await Promise.all([...actions, offline]); await queue.drain();
70
+ assert.equal(order.length, 33); assert.equal(order.at(-1), 'offline');
71
+ assert.equal(queue.pendingCount, 0);
72
+ });
73
+
74
+ test('an inherited async context from a completed callback cannot bypass the current FIFO owner', { timeout: 2000 }, async t => {
75
+ const queue = new MqttCallbackQueue(); const held = deferred(); const entered = deferred(); const scheduled = deferred();
76
+ const order = []; let inherited;
77
+ t.after(() => held.resolve());
78
+ await queue.run(async () => {
79
+ setTimeout(() => {
80
+ inherited = queue.run(async () => { order.push('inherited'); });
81
+ scheduled.resolve();
82
+ }, 0);
83
+ });
84
+ const active = queue.run(async () => { entered.resolve(); await held.promise; order.push('current'); });
85
+ await entered.promise; await scheduled.promise;
86
+ await new Promise(resolve => setImmediate(resolve));
87
+ const bypassed = order.includes('inherited');
88
+ held.resolve(); await Promise.all([active, inherited]); await queue.drain();
89
+ assert.equal(bypassed, false, 'a stale ALS token must not admit concurrent callbacks');
90
+ assert.deepEqual(order, ['current', 'inherited']);
91
+ });
92
+
93
+ test('runtime stop invalidates MQTT first and awaits the callback DB write before reporting stopped', { timeout: 2000 }, async t => {
94
+ const f = fixture(); t.after(() => f.held.resolve()); f.runtime.started = true;
95
+ f.runtime.driver = { disconnect: async () => { f.invalidate(); await f.runtime._handleMqttConnectionState(false, 'test stop'); } };
96
+ const old = runMqttMessageSession(f.current, () => f.runtime._handleMqttSnapshot({ aCTIVE_POWER: 12 }, { connected: true }));
97
+ const oldResult = old.then(() => 'completed', error => error.message);
98
+ await f.entered.promise;
99
+ let stopped = false;
100
+ const stopping = f.runtime.stop().then(() => { stopped = true; });
101
+ await new Promise(resolve => setImmediate(resolve));
102
+ const stoppedBeforeWriteSettled = stopped;
103
+ f.held.resolve(); await stopping;
104
+ assert.equal(stoppedBeforeWriteSettled, false);
105
+ assert.equal(await oldResult, 'E_MQTT_MESSAGE_SESSION_ENDED');
106
+ assert.equal(f.runtime.driver, null); assert.equal(f.runtime.started, false);
107
+ assert.equal(f.last('.info.connection'), false); assert.equal(f.last('.aliases.v1.comm.connected'), false);
108
+ assert.equal(f.writes.some(row => row.id.endsWith('.aliases.v1.r.power') && row.val === 12), false);
109
+ });
@@ -10,7 +10,7 @@ test('disconnected RTU request reconnects without enqueueing behind itself', asy
10
10
  const { key, bus } = acquireBus({ log }, { path: '/dev/eos-test-rtu-a' });
11
11
  bus.client = { connectRTUBuffered(_path, _options, callback) { callback(); }, setID() {}, setTimeout() {}, async readHoldingRegisters() { return { data: [17] }; }, close(callback) { callback(); } };
12
12
  try { assert.deepEqual(await bounded(bus.readHoldingRegisters(1, 100, 0, 1)), { data: [17] }); }
13
- finally { releaseBus(key); }
13
+ finally { await releaseBus(key); }
14
14
  });
15
15
  test('shared RTU bus retains each queued device capability and rejects revoked commands at dispatch', async () => {
16
16
  const { key, bus } = acquireBus({ log }, { path: '/dev/eos-test-rtu-b' });
@@ -31,7 +31,7 @@ test('shared RTU bus retains each queued device capability and rejects revoked c
31
31
  await assert.rejects(second, /NOT_AUTHORIZED/);
32
32
  await third;
33
33
  assert.deepEqual(writes, [{ id: 1, value: 1 }, { id: 3, value: 3 }]);
34
- } finally { releaseBus(key); releaseBus(same.key); }
34
+ } finally { await releaseBus(key); await releaseBus(same.key); }
35
35
  });
36
36
  test('ASCII transport rejects a queued frame after gate closure without touching serial port', async () => {
37
37
  const { key, bus } = acquireAscii({ log }, { path: '/dev/eos-test-ascii' });
@@ -45,5 +45,5 @@ test('ASCII transport rejects a queued frame after gate closure without touching
45
45
  allowed = false; release();
46
46
  await assert.rejects(request, /NOT_AUTHORIZED/);
47
47
  assert.equal(writes, 0);
48
- } finally { releaseAscii(key); }
48
+ } finally { await releaseAscii(key); }
49
49
  });
@@ -0,0 +1,472 @@
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 net = require('node:net');
6
+ const root = require('node:path').resolve(__dirname, '../../..');
7
+ const { DeviceRuntime } = require(root + '/modules/devices/lib/deviceRuntime');
8
+ const { ModbusDriver } = require(root + '/modules/devices/lib/drivers/modbus');
9
+ const { guardDriver } = require(root + '/modules/devices/operation-guard');
10
+ const { recordReadResponse } = require('../lib/modbusReadEvidence');
11
+ function coRead(values) {
12
+ recordReadResponse(values, Object.keys(values));
13
+ return values;
14
+ }
15
+ function deferred() {
16
+ let resolve;
17
+ const promise = new Promise(done => {
18
+ resolve = done;
19
+ });
20
+ return { promise, resolve };
21
+ }
22
+ const template = require(root + '/modules/devices/lib/templates.json').templates.find(
23
+ t => t.id === 'ess.solax.SolaXHybridX1X3Ess',
24
+ );
25
+ async function fixture(t, connection = {}) {
26
+ const requests = [],
27
+ sockets = new Set(),
28
+ states = new Map(),
29
+ objects = new Map(),
30
+ logs = [],
31
+ holding = { 416: 4, 417: 600, 418: 0, 419: 600, 420: 160 },
32
+ input = { 28: 98, 56: 64936, 57: 65535, 162: 5000, 163: 0, 164: 0, 165: 0 };
33
+ let allowed = true;
34
+ let failCapReads = false;
35
+ let rejectCombined = false;
36
+ let onReply = () => {};
37
+ const server = net.createServer(socket => {
38
+ sockets.add(socket);
39
+ socket.on('close', () => sockets.delete(socket));
40
+ let buffered = Buffer.alloc(0);
41
+ socket.on('data', data => {
42
+ buffered = Buffer.concat([buffered, data]);
43
+ while (buffered.length >= 7) {
44
+ const size = 6 + buffered.readUInt16BE(4);
45
+ if (buffered.length < size) break;
46
+ const p = buffered.subarray(0, size);
47
+ buffered = buffered.subarray(size);
48
+ const fc = p[7],
49
+ addr = p.readUInt16BE(8);
50
+ requests.push({
51
+ fc,
52
+ addr,
53
+ ...(fc === 3 || fc === 4 ? { quantity: p.readUInt16BE(10) } : {}),
54
+ regs:
55
+ fc === 16
56
+ ? Array.from({ length: p.readUInt16BE(10) }, (_, i) => p.readUInt16BE(13 + 2 * i))
57
+ : fc === 6
58
+ ? [p.readUInt16BE(10)]
59
+ : [],
60
+ });
61
+ let out;
62
+ if (fc === 6) {
63
+ out = Buffer.from(p);
64
+ } else if (fc === 16) {
65
+ out = Buffer.from(p.subarray(0, 12));
66
+ out.writeUInt16BE(6, 4);
67
+ } else if (
68
+ (fc === 4 && addr >= 162 && addr <= 165 && failCapReads) ||
69
+ (fc === 3 && addr === 416 && p.readUInt16BE(10) > 1 && rejectCombined)
70
+ ) {
71
+ out = Buffer.alloc(9);
72
+ p.copy(out, 0, 0, 7);
73
+ out.writeUInt16BE(3, 4);
74
+ out[7] = fc | 0x80;
75
+ out[8] = 2;
76
+ } else if (fc === 4 || fc === 3) {
77
+ const count = p.readUInt16BE(10);
78
+ out = Buffer.alloc(9 + 2 * count);
79
+ p.copy(out, 0, 0, 7);
80
+ out.writeUInt16BE(3 + 2 * count, 4);
81
+ out[7] = fc;
82
+ out[8] = count * 2;
83
+ const words = fc === 3 ? holding : input;
84
+ for (let i = 0; i < count; i++) out.writeUInt16BE(words[addr + i] || 0, 9 + 2 * i);
85
+ } else throw Error('Unexpected function ' + fc);
86
+ onReply(requests.at(-1));
87
+ socket.write(out);
88
+ }
89
+ });
90
+ });
91
+ await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
92
+ const adapter = {
93
+ namespace: 'eos-admin.0',
94
+ log: Object.fromEntries(
95
+ ['debug', 'info', 'warn', 'error'].map(level => [level, msg => logs.push({ level, msg })]),
96
+ ),
97
+ setObjectNotExistsAsync: async (id, v) => {
98
+ if (!objects.has(id)) objects.set(id, v);
99
+ },
100
+ extendObjectAsync: async (id, v) => objects.set(id, { ...objects.get(id), ...v }),
101
+ getStateAsync: async id => states.get(id) || null,
102
+ setStateAsync: async (id, v) => states.set(id, { ...v, ts: Date.now() }),
103
+ };
104
+ const cfg = {
105
+ id: 'solax',
106
+ templateId: template.id,
107
+ protocol: 'modbusTcp',
108
+ connection: {
109
+ host: '127.0.0.1',
110
+ port: server.address().port,
111
+ unitId: 1,
112
+ minCommandIntervalMs: 0,
113
+ ...connection,
114
+ },
115
+ };
116
+ const runtime = new DeviceRuntime(adapter, cfg, template, {});
117
+ await runtime.initObjects();
118
+ const driver = guardDriver(new ModbusDriver(adapter, cfg, template, {}), () => allowed);
119
+ runtime.driver = driver;
120
+ t.after(async () => {
121
+ await runtime.stop();
122
+ for (const s of sockets) s.destroy();
123
+ await new Promise(resolve => server.close(resolve));
124
+ });
125
+ return {
126
+ runtime,
127
+ driver,
128
+ adapter,
129
+ cfg,
130
+ states,
131
+ requests,
132
+ logs,
133
+ holding,
134
+ input,
135
+ failCaps: value => {
136
+ failCapReads = value;
137
+ },
138
+ rejectCombined: value => {
139
+ rejectCombined = value;
140
+ },
141
+ onReply: callback => {
142
+ onReply = callback;
143
+ },
144
+ allow: v => {
145
+ allowed = v;
146
+ },
147
+ };
148
+ }
149
+ test('actual SolaX AliasV1 dispatch reaches real loopback Modbus TCP as complete Mode4 block with signed W', async t => {
150
+ const h = await fixture(t);
151
+ const alias = 'devices.solax.aliases.v1.ctrl.powerSetpointW';
152
+ for (const [val, words] of [
153
+ [600, [4, 600, 0, 600, 160]],
154
+ [-600, [4, 64936, 65535, 600, 160]],
155
+ [0, [4, 0, 0, 600, 160]],
156
+ ]) {
157
+ await h.runtime.handleStateChange('eos-admin.0.' + alias, { val, ack: false });
158
+ await h.runtime._flushWriteQueueOnce();
159
+ assert.deepEqual(h.requests.filter(x => x.fc === 16).at(-1), { fc: 16, addr: 160, regs: words });
160
+ assert.equal(h.states.get(alias).val, val);
161
+ assert.equal(h.states.get(alias).ack, true);
162
+ }
163
+ assert.equal(h.requests[0].fc, 6);
164
+ assert.equal(h.requests[0].addr, 0);
165
+ // Revoke hosted capability after the valid connection; no new control packet or success ack allowed.
166
+ const count = h.requests.length;
167
+ h.allow(false);
168
+ await h.runtime.handleStateChange('eos-admin.0.' + alias, { val: 700, ack: false });
169
+ await h.runtime._flushWriteQueueOnce();
170
+ assert.equal(h.requests.length, count);
171
+ assert.notEqual(h.states.get(alias).val, 700);
172
+ assert.ok(h.logs.some(x => String(x.msg).includes('EOS_DEVICES_NOT_AUTHORIZED')));
173
+ console.log(
174
+ JSON.stringify({
175
+ runtime: process.version,
176
+ wireBlocks: h.requests.filter(x => x.fc === 16),
177
+ deniedWritePackets: 0,
178
+ }),
179
+ );
180
+ });
181
+ test('actual read path preserves positive discharge, 98% SoC and valid zero BMS discharge capability', async t => {
182
+ const h = await fixture(t);
183
+ const dp = template.datapoints.filter(x =>
184
+ ['sOC', 'bATTERY_POWER', 'aLLOWED_CHARGE_POWER', 'aLLOWED_DISCHARGE_POWER'].includes(x.id),
185
+ );
186
+ const values = await h.driver.readDatapoints(dp);
187
+ await h.runtime._updateAliases(values, { connected: true });
188
+ assert.equal(values.bATTERY_POWER, 600);
189
+ assert.equal(values.sOC, 98);
190
+ assert.equal(values.aLLOWED_DISCHARGE_POWER, 0);
191
+ assert.equal(h.states.get('devices.solax.aliases.v1.r.power').val, 600);
192
+ assert.equal(h.states.get('devices.solax.aliases.v1.r.allowedDischargePower').val, 0);
193
+ assert.equal(h.runtime.aliasByStateRelId.has('devices.solax.aliases.v1.r.allowDischarge'), false);
194
+ console.log(JSON.stringify({ runtime: process.version, measured: values, zeroCapabilityPreserved: true }));
195
+ });
196
+
197
+ test('SolaX readback uses actual mode4 poll and becomes unknown after mode8 or missing current mode', async t => {
198
+ const h = await fixture(t);
199
+ const readback = 'devices.solax.aliases.v1.r.powerSetpointReadbackW';
200
+ await h.runtime.handleStateChange('eos-admin.0.devices.solax.aliases.v1.ctrl.powerSetpointW', {
201
+ val: 700,
202
+ ack: false,
203
+ });
204
+ await h.runtime._flushWriteQueueOnce();
205
+ assert.equal(h.states.get('devices.solax.sET_ACTIVE_POWER').val, 700, 'raw RW object is command-ack optimistic');
206
+ assert.equal(h.states.has(readback), false, 'semantic readback never created by write ack');
207
+ const dp = template.datapoints.filter(x =>
208
+ ['sET_CONTROL_MODE', 'sET_ACTIVE_POWER', 'vPP_WAIT_TIMEOUT', 'vPP_NEXT_MOTION'].includes(x.id),
209
+ );
210
+ const values = await h.driver.readDatapoints(dp);
211
+ await h.runtime._updateAliases(values, { connected: true });
212
+ assert.equal(values.sET_CONTROL_MODE, 4);
213
+ assert.ok(
214
+ h.requests.some(request => request.fc === 3 && request.addr === 416 && request.quantity === 5),
215
+ 'mode and target are co-read in the same actual contiguous Modbus response',
216
+ );
217
+ assert.equal(h.states.get(readback).val, 600, 'readback reflects different actual wire reply');
218
+ h.holding[416] = 8;
219
+ h.holding[417] = 1;
220
+ h.holding[418] = 500;
221
+ const otherMode = await h.driver.readDatapoints(dp);
222
+ await h.runtime._updateAliases(otherMode, { connected: true });
223
+ assert.equal(otherMode.sET_CONTROL_MODE, 8);
224
+ assert.equal(h.states.get(readback).val, null, 'mode8 words are not a Mode4 power target');
225
+ await h.runtime._updateAliases({ sET_ACTIVE_POWER: 900 }, { connected: true });
226
+ assert.equal(h.states.get(readback).val, null, 'old cached mode cannot qualify current target');
227
+ console.log(
228
+ JSON.stringify({
229
+ runtime: process.version,
230
+ rawCommandAck: 700,
231
+ actualMode4Readback: 600,
232
+ mode8Interpretation: null,
233
+ interpretationRequiresMode4: true,
234
+ }),
235
+ );
236
+ });
237
+
238
+ test('unknown, invalid, disconnected and expired mode context never keeps a usable target or fabricates freshness', async t => {
239
+ const h = await fixture(t),
240
+ id = 'devices.solax.aliases.v1.r.powerSetpointReadbackW';
241
+ let now = 1000000;
242
+ t.mock.method(Date, 'now', () => now);
243
+ h.runtime._liveAliasRefreshMs = 5000;
244
+ await h.runtime._updateAliases(coRead({ sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 0 }), { connected: true });
245
+ assert.equal(h.states.get(id).val, 0, 'actual zero is valid');
246
+ const pairedAt = h.states.get(id).ts;
247
+ now += 5000;
248
+ await h.runtime._updateAliases({ bATTERY_POWER: 2 }, { connected: true });
249
+ assert.equal(h.states.get(id).ts, pairedAt, 'unrelated live poll never refreshes readback');
250
+ await h.runtime._ackWrittenValue(h.runtime.dpById.get('sET_CONTROL_MODE'), 4);
251
+ await h.runtime._updateAliases({ sET_ACTIVE_POWER: 500 }, { connected: true });
252
+ assert.equal(h.states.get(id).val, null, 'optimistic mode ack cannot qualify the target');
253
+ for (const mode of [null, NaN, undefined, '4', 0, 8]) {
254
+ await h.runtime._updateAliases(coRead({ sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 600 }), { connected: true });
255
+ await h.runtime._updateAliases({ sET_CONTROL_MODE: mode, sET_ACTIVE_POWER: 600 }, { connected: true });
256
+ assert.equal(h.states.get(id).val, null);
257
+ }
258
+ for (const target of [null, NaN, undefined, '600', Infinity]) {
259
+ await h.runtime._updateAliases({ sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: target }, { connected: true });
260
+ assert.equal(h.states.get(id).val, null);
261
+ }
262
+ await h.runtime._updateAliases(coRead({ sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 600 }), { connected: true });
263
+ now += h.runtime._qualifiedAliasMaxAgeMs + 1;
264
+ await h.runtime._updateAliases({ sOC: 98 }, { connected: true });
265
+ assert.equal(h.states.get(id).val, null, 'existing poll invalidates expired paired sample');
266
+ await h.runtime._updateAliases(coRead({ sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 600 }), { connected: true });
267
+ await h.runtime._updateAliases({}, { connected: false });
268
+ assert.equal(h.states.get(id).val, null);
269
+ await h.runtime._updateAliases(
270
+ { sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 600 },
271
+ { connected: true, diagnosticsOnly: true },
272
+ );
273
+ assert.equal(h.states.get(id).val, null, 'diagnostic cached snapshots cannot create evidence');
274
+ await h.runtime._updateAliases(coRead({ sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 600 }), { connected: true });
275
+ await h.runtime.stop();
276
+ assert.equal(h.states.get(id).val, null, 'confirmed stop clears prior readback evidence');
277
+ });
278
+
279
+ test('only the exact verified mode descriptor enables contextual readback; the existing slow poll includes both fields', () => {
280
+ const { buildSemanticAliasDefinitions } = require(root + '/modules/devices/lib/deviceAliasSemantics');
281
+ const paths = ['sET_CONTROL_MODE', 'sET_ACTIVE_POWER'];
282
+ const polling = template.driverHints.polling;
283
+ assert.equal(polling.fastDpIds.includes(paths[0]), polling.fastDpIds.includes(paths[1]));
284
+ const slow = polling.slowDpIds || template.datapoints.map(dp => dp.id);
285
+ for (const id of paths) assert.ok(slow.includes(id));
286
+ for (const mutation of [
287
+ t =>
288
+ t.datapoints.splice(
289
+ t.datapoints.findIndex(dp => dp.id === 'sET_CONTROL_MODE'),
290
+ 1,
291
+ ),
292
+ t => {
293
+ t.datapoints.find(dp => dp.id === 'sET_CONTROL_MODE').source.read.address = 123;
294
+ },
295
+ t => {
296
+ t.datapoints.find(dp => dp.id === 'sET_CONTROL_MODE').type = 'string';
297
+ },
298
+ ]) {
299
+ const copy = structuredClone(template);
300
+ mutation(copy);
301
+ const result = buildSemanticAliasDefinitions({ baseId: 'devices.solax', template: copy });
302
+ assert.equal(result.coverage['r.powerSetpointReadbackW'].status, 'unavailable');
303
+ assert.equal(result.coverage['r.powerSetpointReadbackW'].reason, 'readContextDescriptorChanged');
304
+ }
305
+ });
306
+
307
+ for (const split of ['isolated', 'adaptive', 'maxReadRegs']) {
308
+ test(`separate ${split} register replies cannot combine old mode4 with mode8 target words`, async t => {
309
+ const h = await fixture(
310
+ t,
311
+ split === 'isolated' ? { isolateReadDatapoints: true } : split === 'maxReadRegs' ? { maxReadRegs: 2 } : {},
312
+ );
313
+ if (split === 'adaptive') h.rejectCombined(true);
314
+ h.onReply(request => {
315
+ if (request.fc === 3 && request.addr === 416 && request.quantity === 1) {
316
+ h.holding[416] = 8;
317
+ h.holding[417] = 1;
318
+ h.holding[418] = 500;
319
+ }
320
+ });
321
+ const dp = template.datapoints.filter(x => ['sET_CONTROL_MODE', 'sET_ACTIVE_POWER'].includes(x.id));
322
+ const values = await h.driver.readDatapoints(dp);
323
+ assert.equal(values.sET_CONTROL_MODE, 4);
324
+ assert.equal(values.sET_ACTIVE_POWER, 32768001, 'raw words expose the conflicting layout');
325
+ await h.runtime._updateAliases(values, { connected: true });
326
+ assert.equal(h.states.get('devices.solax.aliases.v1.r.powerSetpointReadbackW').val, null);
327
+ assert.ok(h.requests.some(request => request.fc === 3 && request.addr === 417 && request.quantity === 2));
328
+ assert.equal(
329
+ h.requests.some(request => request.fc === 6 || request.fc === 16),
330
+ false,
331
+ );
332
+ });
333
+ }
334
+
335
+ test('even a full cached copy cannot manufacture the actual response provenance', async t => {
336
+ const h = await fixture(t);
337
+ const values = await h.driver.readDatapoints(
338
+ template.datapoints.filter(x => ['sET_CONTROL_MODE', 'sET_ACTIVE_POWER'].includes(x.id)),
339
+ );
340
+ const readback = 'devices.solax.aliases.v1.r.powerSetpointReadbackW';
341
+ await h.runtime._updateAliases(values, { connected: true });
342
+ assert.equal(h.states.get(readback).val, 600);
343
+ await h.runtime._updateAliases({ ...values }, { connected: true });
344
+ assert.equal(h.states.get(readback).val, null);
345
+ });
346
+
347
+ for (const pauseAtReadback of [false, true]) {
348
+ test(`stop drains ${pauseAtReadback ? 'submitted readback' : 'earlier alias'} work without reviving an old sample`, async t => {
349
+ const h = await fixture(t);
350
+ const readback = 'devices.solax.aliases.v1.r.powerSetpointReadbackW';
351
+ const reached = deferred(),
352
+ resume = deferred();
353
+ const original = h.adapter.setStateAsync;
354
+ let once = true;
355
+ h.adapter.setStateAsync = async (id, state) => {
356
+ if (once && (pauseAtReadback ? id === readback : id !== readback)) {
357
+ once = false;
358
+ reached.resolve();
359
+ await resume.promise;
360
+ }
361
+ return original(id, state);
362
+ };
363
+ const update = h.runtime._updateAliases(coRead({ sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 600, sOC: 98 }), {
364
+ connected: true,
365
+ });
366
+ await reached.promise;
367
+ let stopFinished = false;
368
+ const stop = h.runtime.stop().then(() => {
369
+ stopFinished = true;
370
+ });
371
+ if (pauseAtReadback) {
372
+ await new Promise(resolve => setImmediate(resolve));
373
+ assert.equal(stopFinished, false, 'confirmed stop waits for the submitted readback DB write');
374
+ } else {
375
+ await stop;
376
+ }
377
+ resume.resolve();
378
+ await Promise.all([update, stop]);
379
+ assert.equal(
380
+ h.states.get(readback).val,
381
+ null,
382
+ 'old operation cannot restore a fresh numeric target after stop',
383
+ );
384
+ });
385
+ }
386
+
387
+ test('real unchanged BMS caps stay fresh beyond 60s, while failed/skipped/unrelated polls do not renew them', async t => {
388
+ const h = await fixture(t);
389
+ h.input[164] = 9566;
390
+ let now = 1000000;
391
+ t.mock.method(Date, 'now', () => now);
392
+ h.runtime._liveAliasRefreshMs = 3000;
393
+ const ids = ['sOC', 'aLLOWED_CHARGE_POWER', 'aLLOWED_DISCHARGE_POWER'];
394
+ const dp = template.datapoints.filter(x => ids.includes(x.id));
395
+ const path = 'devices.solax.aliases.v1.r.allowedDischargePower';
396
+ for (let i = 0; i <= 25; i++) {
397
+ const values = await h.driver.readDatapoints(dp);
398
+ await h.runtime._updateAliases(values, { connected: true });
399
+ assert.equal(h.states.get(path).val, 9566, 'healthy constant numeric limit remains available');
400
+ assert.equal(h.states.get('devices.solax.aliases.v1.r.allowedChargePower').val, 5000);
401
+ assert.equal(h.states.get('devices.solax.aliases.v1.r.allowedChargePower').ts, now);
402
+ assert.equal(h.states.get(path).ts, now, 'real constant samples renew freshness at the existing cadence');
403
+ now += 3000;
404
+ }
405
+ const sampleAt = h.states.get(path).ts;
406
+ const capsRequests = h.requests.filter(request => request.fc === 4 && request.addr === 162);
407
+ assert.equal(capsRequests.length, 26);
408
+ assert.ok(
409
+ capsRequests.every(request => request.quantity === 4),
410
+ 'one contiguous cap read per cycle',
411
+ );
412
+ h.failCaps(true);
413
+ await h.runtime._updateAliases(await h.driver.readDatapoints(dp), { connected: true });
414
+ assert.equal(h.states.get(path).ts, sampleAt, 'failed optional response must not renew the cap');
415
+ const failedRequests = h.requests.length;
416
+ now += 3000;
417
+ await h.runtime._updateAliases(await h.driver.readDatapoints(dp), { connected: true });
418
+ assert.equal(h.states.get(path).ts, sampleAt, 'skipped optional response must not renew the cap');
419
+ assert.ok(h.requests.slice(failedRequests).every(request => request.addr !== 162));
420
+ now += 3000;
421
+ await h.runtime._updateAliases({ sOC: 98 }, { connected: true });
422
+ assert.equal(h.states.get(path).ts, sampleAt);
423
+ });
424
+
425
+ test('runtime fast scheduler includes only the two existing numeric cap sources without speeding up the full map', async t => {
426
+ const h = await fixture(t);
427
+ const polled = [];
428
+ const timeouts = new Map();
429
+ let now = 1000000;
430
+ t.mock.method(Date, 'now', () => now);
431
+ // Exercise production scheduling while the transport is controlled separately
432
+ // by the real TCP test above. No real time, socket, or physical write is needed.
433
+ t.mock.method(global, 'setTimeout', (fn, delay) => {
434
+ const token = {};
435
+ timeouts.set(token, { fn, delay });
436
+ return token;
437
+ });
438
+ t.mock.method(global, 'clearTimeout', token => timeouts.delete(token));
439
+ h.runtime._startHeartbeatChecker = () => {};
440
+ h.runtime._createDriver = () => ({
441
+ async disconnect() {},
442
+ async readDatapoints(dps) {
443
+ polled.push(dps.map(dp => dp.id));
444
+ return { sOC: 98, aLLOWED_CHARGE_POWER: 5000, aLLOWED_DISCHARGE_POWER: 9566 };
445
+ },
446
+ });
447
+ await h.runtime.start();
448
+ assert.deepEqual(
449
+ polled[0],
450
+ template.datapoints.map(dp => dp.id),
451
+ 'startup retains the full initial poll',
452
+ );
453
+ for (let i = 0; i < 3; i++) {
454
+ const timer = timeouts.get(h.runtime.pollTimer);
455
+ assert.ok(timer);
456
+ assert.equal(timer.delay, 1000, 'existing command cadence is unchanged');
457
+ timeouts.delete(h.runtime.pollTimer);
458
+ now += timer.delay;
459
+ timer.fn();
460
+ await new Promise(resolve => setImmediate(resolve));
461
+ }
462
+ assert.equal(polled.length, 2, 'fast read remains every 3s; no added loop or extra full poll');
463
+ const expected = new Set([
464
+ ...template.driverHints.polling.fastDpIds,
465
+ 'aLLOWED_CHARGE_POWER',
466
+ 'aLLOWED_DISCHARGE_POWER',
467
+ ]);
468
+ assert.deepEqual(new Set(polled[1]), expected);
469
+ assert.equal(polled[1].includes('sET_CONTROL_MODE'), false, 'unrelated slow mode polling stays slow');
470
+ await h.runtime.stop();
471
+ assert.equal(timeouts.size, 0);
472
+ });
@@ -13,5 +13,5 @@
13
13
  "skipLibCheck": true,
14
14
  "types": ["node"]
15
15
  },
16
- "files": ["lib/deviceAliasSemantics.js", "lib/deviceAliasFreshness.js"]
16
+ "files": ["lib/deviceAliasSemantics.js", "lib/deviceAliasFreshness.js", "lib/modbusReadEvidence.js"]
17
17
  }
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "checkJs": true,
5
+ "noEmit": true,
6
+ "target": "ES2022",
7
+ "module": "node16",
8
+ "moduleResolution": "node16",
9
+ "types": ["node"],
10
+ "strict": true,
11
+ "noUncheckedIndexedAccess": true,
12
+ "exactOptionalPropertyTypes": true,
13
+ "noImplicitOverride": true,
14
+ "noImplicitReturns": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "skipLibCheck": true
18
+ },
19
+ "files": ["lib/drivers/mqttPendingOperations.js"]
20
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "checkJs": true,
5
+ "strict": true,
6
+ "noEmit": true,
7
+ "target": "ES2022",
8
+ "module": "node16",
9
+ "moduleResolution": "node16",
10
+ "skipLibCheck": true,
11
+ "types": [
12
+ "node"
13
+ ]
14
+ },
15
+ "files": [
16
+ "lib/drivers/modbusSerialLease.js"
17
+ ]
18
+ }