iobroker.eos-admin 9.0.19 → 9.0.20

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 (460) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +4 -4
  2. package/README.md +5 -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-CRD3XVom.js} +1 -1
  7. package/adminWww/assets/{Adapters-C9fcSdWm.js → Adapters-Cuf0X0CU.js} +1 -1
  8. package/adminWww/assets/{ConfigManager-BeeLlT6D.js → ConfigManager-B8ycQt1C.js} +1 -1
  9. package/adminWww/assets/{Enums-FqnXWl8U.js → Enums-CctVCgZX.js} +1 -1
  10. package/adminWww/assets/{Fields-DMgrt5Pi.js → Fields-onm4DfoO.js} +1 -1
  11. package/adminWww/assets/{Files-CIHtt12g.js → Files-OLP3Rwc7.js} +1 -1
  12. package/adminWww/assets/{Hosts-fPLBzvTy.js → Hosts-C31oqMcW.js} +1 -1
  13. package/adminWww/assets/{Instances-4XaVQlrT.js → Instances-DFdvJ9pa.js} +1 -1
  14. package/adminWww/assets/{Intro-5TKriiLO.js → Intro-DvsFJxU0.js} +1 -1
  15. package/adminWww/assets/{Logs-33zcIds-.js → Logs-Zqg2Bqv6.js} +1 -1
  16. package/adminWww/assets/{Objects-CNQPVbNG.js → Objects-CpWZp6yp.js} +1 -1
  17. package/adminWww/assets/{Overview-BskXGOc8.js → Overview-BsKUo298.js} +1 -1
  18. package/adminWww/assets/{State-C8SJ_Iqo.js → State-D_xwlhhb.js} +1 -1
  19. package/adminWww/assets/{UsedResources-CgqRa9ei.js → UsedResources-C79N6yZx.js} +1 -1
  20. package/adminWww/assets/{Users-0JVYWR9u.js → Users-WgC0O8P0.js} +1 -1
  21. package/adminWww/assets/{bootstrap-D16lu6rd.js → bootstrap-BcfBoIoa.js} +3 -3
  22. package/adminWww/assets/{hostInit-C8YZJuzi.js → hostInit-B7bBV7cH.js} +1 -1
  23. package/adminWww/assets/icons/nexowatt-180.png +0 -0
  24. package/adminWww/assets/{icons-material-CiNJ_6Ur.js → icons-material-D1JYmRTj.js} +1 -1
  25. package/adminWww/assets/{index-DA9Sphgh.js → index-DbiuoDjo.js} +2 -2
  26. package/adminWww/assets/{installSVGRenderer-DPdkRa_d.js → installSVGRenderer-BAY-Pzp-.js} +1 -1
  27. package/adminWww/assets/{mf-entry-bootstrap-0-a7ab91de.js → mf-entry-bootstrap-0-33384c20.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.20.js +12 -0
  32. package/adminWww/remoteEntry.js +1 -1
  33. package/build/lib/eosDeviceEmsPlan.js +18 -5
  34. package/build/lib/eosDeviceEmsPlan.js.map +1 -1
  35. package/build/lib/eosDeviceEmsService.js +52 -2
  36. package/build/lib/eosDeviceEmsService.js.map +1 -1
  37. package/build/lib/eosLegacyMigration.js +26 -1
  38. package/build/lib/eosLegacyMigration.js.map +1 -1
  39. package/build/lib/eosModuleHost.js +40 -0
  40. package/build/lib/eosModuleHost.js.map +1 -1
  41. package/build/lib/eosStateSubscriptions.js +59 -2
  42. package/build/lib/eosStateSubscriptions.js.map +1 -1
  43. package/build/lib/web.js +3 -0
  44. package/build/lib/web.js.map +1 -1
  45. package/docs/reports/unified-9.0.20/ANFORDERUNGEN_UND_INBETRIEBNAHME.md +159 -0
  46. package/docs/reports/unified-9.0.20/DEVICE_COMMAND_DELIVERY_REVIEW.md +82 -0
  47. package/docs/reports/unified-9.0.20/DEVICE_LIFECYCLE_REVIEW.md +46 -0
  48. package/docs/reports/unified-9.0.20/DEVICE_PLAN_REVIEW.md +33 -0
  49. package/docs/reports/unified-9.0.20/DEVICE_POWER_CAPABILITY_REVIEW.md +25 -0
  50. package/docs/reports/unified-9.0.20/FARM_CONTROLLER_REVIEW.md +27 -0
  51. package/docs/reports/unified-9.0.20/FARM_DIAGNOSE_UI.md +81 -0
  52. package/docs/reports/unified-9.0.20/FARM_DISPATCH_REVIEW.md +47 -0
  53. package/docs/reports/unified-9.0.20/HISTORY_REVIEW.md +68 -0
  54. package/docs/reports/unified-9.0.20/INFLUXDB2_INSTALLER_UI.md +39 -0
  55. package/docs/reports/unified-9.0.20/INFLUX_CREDENTIAL_NETWORK_REVIEW.md +38 -0
  56. package/docs/reports/unified-9.0.20/INFLUX_DIRECT_UNABHAENGIGE_PRUEFUNG.md +64 -0
  57. package/docs/reports/unified-9.0.20/INFLUX_RUNTIME_INTEGRATION_REVIEW.md +53 -0
  58. package/docs/reports/unified-9.0.20/INFLUX_RUNTIME_UNABHAENGIGE_PRUEFUNG.md +34 -0
  59. package/docs/reports/unified-9.0.20/INFLUX_TRANSPORT_ABSCHLUSSPRUEFUNG.md +55 -0
  60. package/docs/reports/unified-9.0.20/LOGIN_WEBAPP_LOGO.md +29 -0
  61. package/docs/reports/unified-9.0.20/MIGRATION_REVIEW.md +35 -0
  62. package/docs/reports/unified-9.0.20/PRUEFBERICHT.md +54 -0
  63. package/docs/reports/unified-9.0.20/PWA_ANONYMOUS_HTTPS_REVIEW.md +28 -0
  64. package/docs/reports/unified-9.0.20/PWA_ICON_UNABHAENGIGE_PRUEFUNG.md +60 -0
  65. package/docs/reports/unified-9.0.20/SERIAL_LIFECYCLE_REVIEW.md +37 -0
  66. package/docs/reports/unified-9.0.20/SOLAX_READBACK_REVIEW.md +43 -0
  67. package/docs/reports/unified-9.0.20/SOLAX_READBACK_UNABHAENGIGE_PRUEFUNG.md +34 -0
  68. package/docs/reports/unified-9.0.20/STATIC_REVIEW_DE.md +175 -0
  69. package/docs/reports/unified-9.0.20/STORAGE_COMMAND_ACK_REVIEW.md +36 -0
  70. package/docs/reports/unified-9.0.20/TARIFF_REPORT_REVIEW.md +29 -0
  71. package/docs/reports/unified-9.0.20/VISUALISIERUNG.md +64 -0
  72. package/docs/reports/unified-9.0.20/history-setup-navigation-proxy.txt +26 -0
  73. package/docs/reports/unified-9.0.20/history-setup-navigation-ssr.txt +7 -0
  74. package/docs/reports/unified-9.0.20/history-setup-ui-lint.txt +0 -0
  75. package/docs/reports/unified-9.0.20/history-setup-ui-node22.txt +102 -0
  76. package/docs/reports/unified-9.0.20/history-setup-ui-node24.txt +23 -0
  77. package/docs/reports/unified-9.0.20/history-setup-ui-security.txt +0 -0
  78. package/docs/reports/unified-9.0.20/history-setup-ui-typecheck.txt +0 -0
  79. package/docs/reports/unified-9.0.20/login-pwa-branding-hashes.txt +9 -0
  80. package/docs/reports/unified-9.0.20/login-pwa-branding-node22.txt +42 -0
  81. package/docs/reports/unified-9.0.20/login-pwa-branding-node24.txt +13 -0
  82. package/docs/reports/unified-9.0.20/raw/INDEX.json +1913 -0
  83. package/docs/reports/unified-9.0.20/raw/additional-audit/device/baseline-node22.log +16 -0
  84. package/docs/reports/unified-9.0.20/raw/additional-audit/device/baseline-node24.log +14 -0
  85. package/docs/reports/unified-9.0.20/raw/additional-audit/device/lint-after.json +1 -0
  86. package/docs/reports/unified-9.0.20/raw/additional-audit/device/lint-before.json +1 -0
  87. package/docs/reports/unified-9.0.20/raw/additional-audit/device/modbus-stop-backoff.cjs +22 -0
  88. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-control-review.log +29 -0
  89. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-final.json +18 -0
  90. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-final.log +325 -0
  91. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-review.log +278 -0
  92. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-final.json +18 -0
  93. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-final.log +58 -0
  94. package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-review.log +51 -0
  95. package/docs/reports/unified-9.0.20/raw/additional-audit/history/api-gaps-before.log +64 -0
  96. package/docs/reports/unified-9.0.20/raw/additional-audit/history/api-negative-before.log +46 -0
  97. package/docs/reports/unified-9.0.20/raw/additional-audit/history/chart-gaps-before.log +127 -0
  98. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-after.log +67 -0
  99. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-before.log +61 -0
  100. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-eslint-js.log +0 -0
  101. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-eslint-ts.log +0 -0
  102. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-node22.log +442 -0
  103. package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-node24.log +78 -0
  104. package/docs/reports/unified-9.0.20/raw/additional-audit/history/fix.py +73 -0
  105. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-eslint-final.json +7 -0
  106. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-final-node22.log +279 -0
  107. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-final-node24.log +52 -0
  108. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-followup-node22.log +223 -0
  109. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-followup-node24.log +43 -0
  110. package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-own-cache.log +17 -0
  111. package/docs/reports/unified-9.0.20/raw/additional-audit/history/negative-pricing-before.log +96 -0
  112. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node22-after.log +66 -0
  113. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node22-repro.log +8 -0
  114. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node24-after.log +17 -0
  115. package/docs/reports/unified-9.0.20/raw/additional-audit/history/node24-repro.log +8 -0
  116. package/docs/reports/unified-9.0.20/raw/additional-audit/history/repro.cjs +39 -0
  117. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/chromium-probe.log +3 -0
  118. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/patch-live.py +101 -0
  119. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/repro-live-display.cjs +26 -0
  120. package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/repro-live-display.log +36 -0
  121. package/docs/reports/unified-9.0.20/raw/audit-full.log +345 -0
  122. package/docs/reports/unified-9.0.20/raw/audit-full.result.json +14 -0
  123. package/docs/reports/unified-9.0.20/raw/audit-runtime.log +23 -0
  124. package/docs/reports/unified-9.0.20/raw/audit-runtime.result.json +15 -0
  125. package/docs/reports/unified-9.0.20/raw/backend-final.log +5 -0
  126. package/docs/reports/unified-9.0.20/raw/backend-final.result.json +14 -0
  127. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node22.result.json +20 -0
  128. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node22.tap +721 -0
  129. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node24.result.json +20 -0
  130. package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node24.tap +127 -0
  131. package/docs/reports/unified-9.0.20/raw/commissioning-evidence.json +69 -0
  132. package/docs/reports/unified-9.0.20/raw/commissioning-failed-init-drain-919-before.log +14 -0
  133. package/docs/reports/unified-9.0.20/raw/commissioning-final-node22.log +882 -0
  134. package/docs/reports/unified-9.0.20/raw/commissioning-final-node24.log +149 -0
  135. package/docs/reports/unified-9.0.20/raw/commissioning-lint.log +0 -0
  136. package/docs/reports/unified-9.0.20/raw/commissioning-planner-919-before.log +70 -0
  137. package/docs/reports/unified-9.0.20/raw/commissioning-retained-readiness-before.log +34 -0
  138. package/docs/reports/unified-9.0.20/raw/commissioning-runtime-retry-919-before.log +46 -0
  139. package/docs/reports/unified-9.0.20/raw/commissioning-types-node24.log +0 -0
  140. package/docs/reports/unified-9.0.20/raw/device-farm-protocol/DEVICE_FARM_READONLY_REVIEW.md +66 -0
  141. package/docs/reports/unified-9.0.20/raw/device-farm-protocol/run-readback-tests.cjs +13 -0
  142. package/docs/reports/unified-9.0.20/raw/device-farm-protocol/solax-control-chain.test.cjs +58 -0
  143. package/docs/reports/unified-9.0.20/raw/device-lifecycle-baseline-node22.log +16 -0
  144. package/docs/reports/unified-9.0.20/raw/device-lifecycle-baseline-node24.log +14 -0
  145. package/docs/reports/unified-9.0.20/raw/device-lifecycle-evidence.json +55 -0
  146. package/docs/reports/unified-9.0.20/raw/device-lifecycle-lint-after.json +1 -0
  147. package/docs/reports/unified-9.0.20/raw/device-lifecycle-lint-before.json +1 -0
  148. package/docs/reports/unified-9.0.20/raw/device-lifecycle-modbus-stop-backoff.cjs +22 -0
  149. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-control-review.log +29 -0
  150. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-final.json +18 -0
  151. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-final.log +325 -0
  152. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-review.log +278 -0
  153. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-final.json +18 -0
  154. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-final.log +58 -0
  155. package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-review.log +51 -0
  156. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node22.log +0 -0
  157. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node22.result.json +15 -0
  158. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node24.log +0 -0
  159. package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node24.result.json +15 -0
  160. package/docs/reports/unified-9.0.20/raw/farm-controller/controller-node22.log +110 -0
  161. package/docs/reports/unified-9.0.20/raw/farm-controller/controller-node24.log +24 -0
  162. package/docs/reports/unified-9.0.20/raw/farm-controller/evidence.json +33 -0
  163. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-lint.txt +0 -0
  164. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-node22.txt +113 -0
  165. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-node24.txt +26 -0
  166. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-security.txt +0 -0
  167. package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-typecheck.txt +0 -0
  168. package/docs/reports/unified-9.0.20/raw/farm-dispatch/allocator-baseline.jsonl +6 -0
  169. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-before.log +138 -0
  170. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-main-delta.patch +77 -0
  171. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-main-lint.json +7 -0
  172. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node22.log +64 -0
  173. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node22.result.json +14 -0
  174. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node24.log +18 -0
  175. package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node24.result.json +14 -0
  176. package/docs/reports/unified-9.0.20/raw/final-ui-independent-review.json +194 -0
  177. package/docs/reports/unified-9.0.20/raw/frontend-build.log +152 -0
  178. package/docs/reports/unified-9.0.20/raw/frontend-build.result.json +14 -0
  179. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node22.json +35 -0
  180. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node22.result.json +17 -0
  181. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node24.json +31 -0
  182. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node24.result.json +17 -0
  183. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-before.json +31 -0
  184. package/docs/reports/unified-9.0.20/raw/independent-influx/parser-reproducer.cjs +9 -0
  185. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node22.result.json +18 -0
  186. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node22.tap +34 -0
  187. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node24.result.json +18 -0
  188. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node24.tap +11 -0
  189. package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra.test.cjs +9 -0
  190. package/docs/reports/unified-9.0.20/raw/independent-solax/node22-focused.log +165 -0
  191. package/docs/reports/unified-9.0.20/raw/independent-solax/node24-focused.log +35 -0
  192. package/docs/reports/unified-9.0.20/raw/independent-solax/review-receipt.json +57 -0
  193. package/docs/reports/unified-9.0.20/raw/independent-solax/split-response-after.log +1 -0
  194. package/docs/reports/unified-9.0.20/raw/independent-solax/split-response-before.log +1 -0
  195. package/docs/reports/unified-9.0.20/raw/independent-solax/split-response.cjs +16 -0
  196. package/docs/reports/unified-9.0.20/raw/independent-solax/stop-race-generation-guard.log +1 -0
  197. package/docs/reports/unified-9.0.20/raw/independent-solax/stop-race.cjs +13 -0
  198. package/docs/reports/unified-9.0.20/raw/influx-direct/eslint.log +0 -0
  199. package/docs/reports/unified-9.0.20/raw/influx-direct/node22.log +112 -0
  200. package/docs/reports/unified-9.0.20/raw/influx-direct/node24.log +24 -0
  201. package/docs/reports/unified-9.0.20/raw/influx-direct/typecheck.log +0 -0
  202. package/docs/reports/unified-9.0.20/raw/influx-direct-review/hosted-module-history.test.cjs +85 -0
  203. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node22.json +12 -0
  204. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node22.log +100 -0
  205. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node24.json +12 -0
  206. package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node24.log +21 -0
  207. package/docs/reports/unified-9.0.20/raw/influx-direct-review/runtime-after.test.cjs +15 -0
  208. package/docs/reports/unified-9.0.20/raw/influx-direct-review/runtime-loss-before.test.cjs +9 -0
  209. package/docs/reports/unified-9.0.20/raw/influx-direct-review/security-scan.cjs +15 -0
  210. package/docs/reports/unified-9.0.20/raw/influx-direct-review/transport-extra.test.cjs +9 -0
  211. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node22.log +227 -0
  212. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node22.result.json +11 -0
  213. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node24.log +44 -0
  214. package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node24.result.json +11 -0
  215. package/docs/reports/unified-9.0.20/raw/influx-independent/node22.log +112 -0
  216. package/docs/reports/unified-9.0.20/raw/influx-independent/node22.result.json +12 -0
  217. package/docs/reports/unified-9.0.20/raw/influx-independent/node24.log +23 -0
  218. package/docs/reports/unified-9.0.20/raw/influx-independent/node24.result.json +12 -0
  219. package/docs/reports/unified-9.0.20/raw/influx-independent/runtime-after.test.cjs +15 -0
  220. package/docs/reports/unified-9.0.20/raw/influx-independent/transport-extra.test.cjs +9 -0
  221. package/docs/reports/unified-9.0.20/raw/influx-runtime/evidence.json +24 -0
  222. package/docs/reports/unified-9.0.20/raw/influx-runtime/final-node22.log +326 -0
  223. package/docs/reports/unified-9.0.20/raw/influx-runtime/final-node24.log +59 -0
  224. package/docs/reports/unified-9.0.20/raw/influx-runtime/runtime-node22.log +62 -0
  225. package/docs/reports/unified-9.0.20/raw/influx-runtime/runtime-node24.log +16 -0
  226. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-lint.log +0 -0
  227. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-lint.result.json +17 -0
  228. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node22.log +112 -0
  229. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node22.result.json +15 -0
  230. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node24.log +106 -0
  231. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node24.result.json +15 -0
  232. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-typecheck.log +0 -0
  233. package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-typecheck.result.json +15 -0
  234. package/docs/reports/unified-9.0.20/raw/influx-security/source-sha256.json +5 -0
  235. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-lint-final.log +0 -0
  236. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-lint-final.result.json +16 -0
  237. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node22-final.log +124 -0
  238. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node22-final.result.json +14 -0
  239. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node24-final.log +26 -0
  240. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node24-final.result.json +14 -0
  241. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node22-final.log +0 -0
  242. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node22-final.result.json +15 -0
  243. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node24-final.log +0 -0
  244. package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node24-final.result.json +15 -0
  245. package/docs/reports/unified-9.0.20/raw/influx-ui-independent-review-final.json +285 -0
  246. package/docs/reports/unified-9.0.20/raw/influx-ui-independent-review-intermediate.json +285 -0
  247. package/docs/reports/unified-9.0.20/raw/installer-build.log +26 -0
  248. package/docs/reports/unified-9.0.20/raw/installer-build.result.json +14 -0
  249. package/docs/reports/unified-9.0.20/raw/isolation/INDEX.json +332 -0
  250. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-final.log +3 -0
  251. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-final.result.json +13 -0
  252. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-hosted.log +6 -0
  253. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-hosted.result.json +13 -0
  254. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-verified.log +1 -0
  255. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-verified.result.json +13 -0
  256. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family.log +11 -0
  257. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family.result.json +13 -0
  258. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-final.log +3 -0
  259. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-final.result.json +13 -0
  260. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-hosted.log +3 -0
  261. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-hosted.result.json +13 -0
  262. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-verified.log +1 -0
  263. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-verified.result.json +13 -0
  264. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid.log +11 -0
  265. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid.result.json +13 -0
  266. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node22.log +296 -0
  267. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node22.result.json +16 -0
  268. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node24.log +56 -0
  269. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node24.result.json +16 -0
  270. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-node24.log +54 -0
  271. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-node24.result.json +16 -0
  272. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-output-modes.log +1 -0
  273. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-output-modes.result.json +13 -0
  274. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node22.log +332 -0
  275. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node22.result.json +16 -0
  276. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node24.log +62 -0
  277. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node24.result.json +16 -0
  278. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node22.log +342 -0
  279. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node22.result.json +16 -0
  280. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node24.log +72 -0
  281. package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node24.result.json +16 -0
  282. package/docs/reports/unified-9.0.20/raw/isolation/isolation-node22.log +482 -0
  283. package/docs/reports/unified-9.0.20/raw/isolation/isolation-node22.result.json +19 -0
  284. package/docs/reports/unified-9.0.20/raw/isolation/isolation-node24.log +87 -0
  285. package/docs/reports/unified-9.0.20/raw/isolation/migration-lint.log +0 -0
  286. package/docs/reports/unified-9.0.20/raw/isolation/migration-lint.result.json +16 -0
  287. package/docs/reports/unified-9.0.20/raw/isolation/migration-node22.log +330 -0
  288. package/docs/reports/unified-9.0.20/raw/isolation/migration-node22.result.json +16 -0
  289. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24-before.log +72 -0
  290. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24-before.result.json +16 -0
  291. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24.log +60 -0
  292. package/docs/reports/unified-9.0.20/raw/isolation/migration-node24.result.json +16 -0
  293. package/docs/reports/unified-9.0.20/raw/isolation/repro-migration-start-budget.cjs +49 -0
  294. package/docs/reports/unified-9.0.20/raw/isolation/repro-serial-release.cjs +21 -0
  295. package/docs/reports/unified-9.0.20/raw/isolation/repro-sunspec-discovery.cjs +11 -0
  296. package/docs/reports/unified-9.0.20/raw/isolation/serial-before-repro.log +1 -0
  297. package/docs/reports/unified-9.0.20/raw/isolation/serial-before-repro.result.json +13 -0
  298. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node22.log +32 -0
  299. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node22.result.json +14 -0
  300. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node24.log +11 -0
  301. package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node24.result.json +14 -0
  302. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck-final.log +0 -0
  303. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck-final.result.json +28 -0
  304. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck.log +2 -0
  305. package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck.result.json +26 -0
  306. package/docs/reports/unified-9.0.20/raw/isolation/serial-lint.log +0 -0
  307. package/docs/reports/unified-9.0.20/raw/isolation/serial-lint.result.json +18 -0
  308. package/docs/reports/unified-9.0.20/raw/isolation/serial-node22.log +344 -0
  309. package/docs/reports/unified-9.0.20/raw/isolation/serial-node22.result.json +17 -0
  310. package/docs/reports/unified-9.0.20/raw/isolation/serial-node24.log +62 -0
  311. package/docs/reports/unified-9.0.20/raw/isolation/serial-node24.result.json +17 -0
  312. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-after.log +3 -0
  313. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-after.result.json +13 -0
  314. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-before.log +3 -0
  315. package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-before.result.json +15 -0
  316. package/docs/reports/unified-9.0.20/raw/keygen-source.json +6 -0
  317. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/check-919.log +70 -0
  318. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/check-920.log +71 -0
  319. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/diff.json +82 -0
  320. package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/receipt.json +48 -0
  321. package/docs/reports/unified-9.0.20/raw/lint-final.log +16 -0
  322. package/docs/reports/unified-9.0.20/raw/lint-final.result.json +14 -0
  323. package/docs/reports/unified-9.0.20/raw/main-individual-review-before-cache-boundary-fix.json +112 -0
  324. package/docs/reports/unified-9.0.20/raw/main-individual-review-before-capability-ack.json +103 -0
  325. package/docs/reports/unified-9.0.20/raw/main-individual-review-before-farm-diagnostics.json +102 -0
  326. package/docs/reports/unified-9.0.20/raw/main-individual-review-final.json +103 -0
  327. package/docs/reports/unified-9.0.20/raw/main-individual-review.json +93 -0
  328. package/docs/reports/unified-9.0.20/raw/modules-build.log +5 -0
  329. package/docs/reports/unified-9.0.20/raw/modules-build.result.json +14 -0
  330. package/docs/reports/unified-9.0.20/raw/node22-tests-final.log +12471 -0
  331. package/docs/reports/unified-9.0.20/raw/node22-tests-final.result.json +13 -0
  332. package/docs/reports/unified-9.0.20/raw/node22-typecheck-final.log +7 -0
  333. package/docs/reports/unified-9.0.20/raw/node22-typecheck-final.result.json +14 -0
  334. package/docs/reports/unified-9.0.20/raw/node22-version.log +1 -0
  335. package/docs/reports/unified-9.0.20/raw/node24-tests-final.log +2093 -0
  336. package/docs/reports/unified-9.0.20/raw/node24-tests-final.result.json +13 -0
  337. package/docs/reports/unified-9.0.20/raw/node24-typecheck-final.log +5 -0
  338. package/docs/reports/unified-9.0.20/raw/node24-typecheck-final.result.json +14 -0
  339. package/docs/reports/unified-9.0.20/raw/node24-version.log +1 -0
  340. package/docs/reports/unified-9.0.20/raw/power-capability/evidence.json +69 -0
  341. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-existing-regressions-node24.log +94 -0
  342. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-lint.log +0 -0
  343. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-node22.log +304 -0
  344. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-node24.log +56 -0
  345. package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-typecheck.log +0 -0
  346. package/docs/reports/unified-9.0.20/raw/pwa-https/evidence.json +45 -0
  347. package/docs/reports/unified-9.0.20/raw/pwa-https/node22-build.log +21 -0
  348. package/docs/reports/unified-9.0.20/raw/pwa-https/node22-source.log +23 -0
  349. package/docs/reports/unified-9.0.20/raw/pwa-https/node24-build.log +11 -0
  350. package/docs/reports/unified-9.0.20/raw/pwa-https/node24-source.log +11 -0
  351. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-boundaries.test.cjs +45 -0
  352. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-receipt.json +71 -0
  353. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-v22.23.4.tap +34 -0
  354. package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-v24.22.3.tap +11 -0
  355. package/docs/reports/unified-9.0.20/raw/pwa-ui-independent-review-final.json +348 -0
  356. package/docs/reports/unified-9.0.20/raw/repro-failed-init-drain-before.cjs +15 -0
  357. package/docs/reports/unified-9.0.20/raw/repro-profile-replacement-after-unmapped.cjs +15 -0
  358. package/docs/reports/unified-9.0.20/raw/repro-runtime-retry-before.cjs +18 -0
  359. package/docs/reports/unified-9.0.20/raw/sbom-runtime.log +7 -0
  360. package/docs/reports/unified-9.0.20/raw/sbom-runtime.result.json +14 -0
  361. package/docs/reports/unified-9.0.20/raw/sbom-vendor-check.log +1 -0
  362. package/docs/reports/unified-9.0.20/raw/sbom-vendor-check.result.json +14 -0
  363. package/docs/reports/unified-9.0.20/raw/solax-readback-node22.json +30 -0
  364. package/docs/reports/unified-9.0.20/raw/solax-readback-node22.log +542 -0
  365. package/docs/reports/unified-9.0.20/raw/solax-readback-node24.json +30 -0
  366. package/docs/reports/unified-9.0.20/raw/solax-readback-node24.log +97 -0
  367. package/docs/reports/unified-9.0.20/raw/tariff-report-before.log +147 -0
  368. package/docs/reports/unified-9.0.20/raw/tariff-report-evidence.json +48 -0
  369. package/docs/reports/unified-9.0.20/raw/tariff-report-final-node22.log +151 -0
  370. package/docs/reports/unified-9.0.20/raw/tariff-report-final-node24.log +32 -0
  371. package/docs/reports/unified-9.0.20/raw/ui-docs-check.log +6 -0
  372. package/docs/reports/unified-9.0.20/raw/ui-docs-check.result.json +14 -0
  373. package/docs/reports/unified-9.0.20/raw/ui-runtime-final.log +7 -0
  374. package/docs/reports/unified-9.0.20/raw/ui-runtime-final.result.json +14 -0
  375. package/docs/reports/unified-9.0.20/raw/ui-runtime-sync.log +6 -0
  376. package/docs/reports/unified-9.0.20/raw/ui-runtime-sync.result.json +14 -0
  377. package/docs/reports/unified-9.0.20/raw/ui-sbom-check.log +6 -0
  378. package/docs/reports/unified-9.0.20/raw/ui-sbom-check.result.json +14 -0
  379. package/docs/reports/unified-9.0.20/raw/ui-sbom-final.log +6 -0
  380. package/docs/reports/unified-9.0.20/raw/ui-sbom-final.result.json +14 -0
  381. package/docs/reports/unified-9.0.20/raw/ui-secret-final.log +6 -0
  382. package/docs/reports/unified-9.0.20/raw/ui-secret-final.result.json +14 -0
  383. package/docs/reports/unified-9.0.20/raw/ui-security-final.log +8 -0
  384. package/docs/reports/unified-9.0.20/raw/ui-security-final.result.json +14 -0
  385. package/docs/reports/unified-9.0.20/raw/visuals-baseline-919.txt +36 -0
  386. package/docs/reports/unified-9.0.20/raw/visuals-browser-limit.txt +3 -0
  387. package/docs/reports/unified-9.0.20/raw/visuals-lint.txt +0 -0
  388. package/docs/reports/unified-9.0.20/raw/visuals-node22.txt +258 -0
  389. package/docs/reports/unified-9.0.20/raw/visuals-node24.txt +51 -0
  390. package/docs/reports/unified-9.0.20/raw/visuals-security.txt +0 -0
  391. package/docs/reports/unified-9.0.20/raw/visuals-typecheck.txt +0 -0
  392. package/docs/reports/unified-9.0.20/raw/wallet-freshness-after.log +19 -0
  393. package/docs/reports/unified-9.0.20/raw/wallet-freshness-after.result.json +16 -0
  394. package/docs/reports/unified-9.0.20/raw/wallet-freshness-before.log +31 -0
  395. package/docs/reports/unified-9.0.20/raw/wallet-freshness-before.result.json +14 -0
  396. package/docs/reports/unified-9.0.20/raw/wallet-freshness-independent.result.json +13 -0
  397. package/docs/reports/unified-9.0.20/raw/wallet-freshness-independent.tap +10 -0
  398. package/io-package.json +8 -8
  399. package/modules/devices/lib/device-alias-semantics-v1.json +22 -1
  400. package/modules/devices/lib/deviceAliasFreshness.js +1 -0
  401. package/modules/devices/lib/deviceAliasSemantics.js +13 -3
  402. package/modules/devices/lib/deviceRuntime.js +79 -8
  403. package/modules/devices/lib/drivers/modbus.js +90 -21
  404. package/modules/devices/lib/drivers/modbusAsciiBus.js +47 -31
  405. package/modules/devices/lib/drivers/modbusRtuBus.js +33 -9
  406. package/modules/devices/lib/drivers/modbusSerialLease.js +29 -0
  407. package/modules/devices/lib/modbusReadEvidence.js +29 -0
  408. package/modules/devices/test/deviceAliasFreshness.test.js +7 -2
  409. package/modules/devices/test/modbusConnectLifecycle.test.js +148 -0
  410. package/modules/devices/test/modbusSerialLifecycle.test.js +91 -0
  411. package/modules/devices/test/serialOperationGate.test.js +3 -3
  412. package/modules/devices/test/solaxReadbackContext.test.js +472 -0
  413. package/modules/devices/tsconfig.alias-semantics.json +1 -1
  414. package/modules/devices/tsconfig.serial-lifecycle.json +18 -0
  415. package/package.json +9 -7
  416. package/release-manifests/unified/build-environment.cdx.json +6 -6
  417. package/release-manifests/unified/files.json +551 -140
  418. package/release-manifests/unified/obsolete-admin-assets.json +88 -6
  419. package/release-manifests/unified/runtime.cdx.json +23 -23
  420. package/release-manifests/unified/validation.json +15 -15
  421. package/tools/eos-release-check.cjs +2 -2
  422. package/tools/eos-release-manifest.cjs +3 -3
  423. package/ui/admin/react/assets/index-BJO3q7oe.js +13 -0
  424. package/ui/admin/react/assets/{index-CuquHlsY.css → index-ofLP_Y7y.css} +1 -1
  425. package/ui/admin/react/index.html +2 -2
  426. package/ui/docs/security/eslint-reviewed-findings.json +26 -26
  427. package/ui/ems/modules/energy-wallet.js +9 -3
  428. package/ui/ems/modules/storage-control.js +60 -19
  429. package/ui/io-package.json +1 -1
  430. package/ui/lib/influx-config.js +204 -0
  431. package/ui/lib/influx-direct.js +527 -0
  432. package/ui/lib/influx-history-runtime.js +326 -0
  433. package/ui/lib/influx-network-policy.js +112 -0
  434. package/ui/lib/ui-access-policy.js +2 -2
  435. package/ui/main.js +550 -222
  436. package/ui/package.json +12 -6
  437. package/ui/www/app.js +150 -202
  438. package/ui/www/ems-apps.html +2 -1
  439. package/ui/www/ems-apps.js +8 -1
  440. package/ui/www/energy-ledger.html +1 -1
  441. package/ui/www/evcs.html +1 -1
  442. package/ui/www/history.html +1 -1
  443. package/ui/www/history.js +114 -74
  444. package/ui/www/index.html +2 -1
  445. package/ui/www/live-display.js +115 -0
  446. package/ui/www/logic.html +1 -1
  447. package/ui/www/login.css +1 -0
  448. package/ui/www/login.html +2 -1
  449. package/ui/www/manifest.webmanifest +2 -2
  450. package/ui/www/settings.html +2 -1
  451. package/ui/www/simulation.html +1 -1
  452. package/ui/www/smarthome-config.html +1 -1
  453. package/ui/www/smarthome.html +1 -1
  454. package/ui/www/storagefarm-dispatch.js +287 -0
  455. package/ui/www/storagefarm-summary.css +15 -0
  456. package/ui/www/storagefarm.html +15 -1
  457. package/ui/www/storagefarm.js +8 -26
  458. package/ui/www/tariff-report.js +43 -25
  459. package/adminWww/remoteEntry-eos-9.0.19.js +0 -12
  460. package/ui/admin/react/assets/index-Bq5IupDw.js +0 -13
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  const { assertOperationAllowed } = require('../operationContext');
3
+ const { claimSerialPort, boundedSerialClose, serialError } = require('./modbusSerialLease');
3
4
 
4
5
  const ModbusRTU = require('modbus-serial');
5
6
 
@@ -38,6 +39,7 @@ class ModbusRtuBus {
38
39
  this.client = new ModbusRTU();
39
40
  this.connected = false;
40
41
  this.connecting = false;
42
+ this.closing = false;
41
43
 
42
44
  // Serialize all operations on this bus
43
45
  this._queue = Promise.resolve();
@@ -52,6 +54,7 @@ class ModbusRtuBus {
52
54
  }
53
55
 
54
56
  async ensureConnected() {
57
+ if (this.closing) throw serialError('E_MODBUS_SERIAL_CLOSING');
55
58
  if (this.connected) return true;
56
59
  if (this.connecting) {
57
60
  // Wait for current connect attempt
@@ -63,6 +66,7 @@ class ModbusRtuBus {
63
66
 
64
67
  return await this._enqueue(async () => {
65
68
  try {
69
+ if (this.closing) throw serialError('E_MODBUS_SERIAL_CLOSING');
66
70
  if (this.connected) return true;
67
71
  await new Promise((resolve, reject) => {
68
72
  assertOperationAllowed();
@@ -77,6 +81,7 @@ class ModbusRtuBus {
77
81
  (err) => (err ? reject(err) : resolve())
78
82
  );
79
83
  });
84
+ if (this.closing) throw serialError('E_MODBUS_SERIAL_CLOSING');
80
85
  this.connected = true;
81
86
  this.adapter.log.info(`[modbusRtuBus] connected ${this.opts.path} @${this.opts.baudRate} ${this.opts.parity} ${this.opts.dataBits}${this.opts.stopBits}`);
82
87
  return true;
@@ -90,10 +95,14 @@ class ModbusRtuBus {
90
95
  }
91
96
 
92
97
  async close() {
98
+ this.closing = true;
93
99
  return await this._enqueue(async () => {
94
100
  try {
95
- if (this.client) {
96
- try { this.client.close(() => {}); } catch (_) {}
101
+ if (this.client && this.client.isOpen !== false) {
102
+ await new Promise((resolve, reject) => {
103
+ try { this.client.close(error => error ? reject(error) : resolve()); }
104
+ catch (error) { reject(error); }
105
+ });
97
106
  }
98
107
  } finally {
99
108
  this.connected = false;
@@ -108,6 +117,7 @@ class ModbusRtuBus {
108
117
  await this.ensureConnected();
109
118
  return await this._enqueue(async () => {
110
119
  assertOperationAllowed();
120
+ if (this.closing) throw serialError('E_MODBUS_SERIAL_CLOSING');
111
121
  if (!this.connected) throw new Error('Serial transport disconnected before dispatch');
112
122
  this.client.setID(Number(unitId || 1));
113
123
  this.client.setTimeout(Number(timeoutMs || 2000));
@@ -158,23 +168,37 @@ function acquireBus(adapter, opts) {
158
168
 
159
169
  const existing = buses.get(key);
160
170
  if (existing) {
171
+ if (existing.closing) throw serialError('E_MODBUS_SERIAL_CLOSING');
161
172
  existing.refs++;
162
173
  return { key, bus: existing.bus };
163
174
  }
164
175
 
165
- const bus = new ModbusRtuBus(adapter, opts);
166
- buses.set(key, { bus, refs: 1 });
176
+ const releasePort = claimSerialPort((opts.path || '').toString().trim());
177
+ let bus;
178
+ try { bus = new ModbusRtuBus(adapter, opts); }
179
+ catch (error) { releasePort(); throw error; }
180
+ buses.set(key, { bus, refs: 1, closing: false, closePromise: null, releasePort });
167
181
  return { key, bus };
168
182
  }
169
183
 
170
- function releaseBus(key) {
184
+ async function releaseBus(key) {
171
185
  const entry = buses.get(key);
172
186
  if (!entry) return;
187
+ if (entry.closePromise) return await boundedSerialClose(entry.closePromise);
173
188
  entry.refs--;
174
- if (entry.refs <= 0) {
175
- buses.delete(key);
176
- // Close asynchronously
177
- entry.bus.close().catch(() => {});
189
+ if (entry.refs > 0) return;
190
+ entry.closing = true;
191
+ entry.closePromise = entry.bus.close().then(() => {
192
+ // Late completion may release only this exact entry, never a replacement.
193
+ if (buses.get(key) === entry) {
194
+ buses.delete(key);
195
+ entry.releasePort();
196
+ }
197
+ });
198
+ try { await boundedSerialClose(entry.closePromise); }
199
+ catch (error) {
200
+ try { entry.bus.adapter.log.warn('EOS_MODBUS_SERIAL_STOP_UNCONFIRMED'); } catch (_) { /* Diagnostic failure does not restore transport authority. */ }
201
+ throw error;
178
202
  }
179
203
  }
180
204
 
@@ -0,0 +1,29 @@
1
+ // @ts-check
2
+ /* Copyright (c) 2026 NexoWatt. Confidential and proprietary. */
3
+ 'use strict';
4
+ const { resolve } = require('node:path');
5
+ /** In-process ownership only; OS permissions/locks still govern other processes. */
6
+ /** @type {Map<string, symbol>} */
7
+ const leases = new Map();
8
+ /** @param {string} code */
9
+ function serialError(code) { return Object.assign(new Error(code), { code }); }
10
+ /** @param {string} path */
11
+ function claimSerialPort(path) {
12
+ const key = process.platform === 'win32' ? resolve(path).toLowerCase() : resolve(path);
13
+ if (leases.has(key)) throw serialError('E_MODBUS_SERIAL_PORT_BUSY');
14
+ const token = Symbol('modbus-serial-lease');
15
+ leases.set(key, token);
16
+ return () => { if (leases.get(key) === token) leases.delete(key); };
17
+ }
18
+ /** The original close may finish late; only its successful completion releases ownership. */
19
+ /** @param {Promise<void>} operation */
20
+ async function boundedSerialClose(operation) {
21
+ /** @type {ReturnType<typeof setTimeout> | undefined} */
22
+ let timer;
23
+ try {
24
+ await Promise.race([operation, new Promise((_, reject) => {
25
+ timer = setTimeout(() => reject(serialError('E_MODBUS_SERIAL_STOP_TIMEOUT')), 2500);
26
+ })]);
27
+ } finally { clearTimeout(timer); }
28
+ }
29
+ module.exports = { claimSerialPort, boundedSerialClose, serialError };
@@ -0,0 +1,29 @@
1
+ // @ts-check
2
+ 'use strict';
3
+
4
+ // Keep proof local to the actual snapshot. It cannot survive JSON/cache copies,
5
+ // and does not add data points or change the enumerable measurement contract.
6
+ /** @type {WeakMap<object, Map<string, object>>} */
7
+ const responses = new WeakMap();
8
+
9
+ /** Record only decoded values from one completed, validated register response.
10
+ * @param {object} values @param {string[]} ids @returns {void}
11
+ */
12
+ function recordReadResponse(values, ids) {
13
+ let samples = responses.get(values);
14
+ if (!samples) { samples = new Map(); responses.set(values, samples); }
15
+ const response = {};
16
+ for (const id of ids) samples.set(id, response);
17
+ }
18
+
19
+ /** A poll can contain several replies, including adaptive split fallback.
20
+ * Context-sensitive registers must originate in the same actual response.
21
+ * @param {object} values @param {string} target @param {string} context @returns {boolean}
22
+ */
23
+ function hasSameReadResponse(values, target, context) {
24
+ const samples = responses.get(values);
25
+ const response = samples?.get(target);
26
+ return !!response && response === samples?.get(context);
27
+ }
28
+
29
+ module.exports = { recordReadResponse, hasSameReadResponse };
@@ -4,6 +4,7 @@ const test = require('node:test');
4
4
  const assert = require('node:assert/strict');
5
5
  const Module = require('node:module');
6
6
  const templates = require('../lib/templates.json').templates;
7
+ const { recordReadResponse } = require('../lib/modbusReadEvidence');
7
8
  const { buildSemanticAliasDefinitions } = require('../lib/deviceAliasSemantics');
8
9
 
9
10
  const originalLoad = Module._load;
@@ -94,7 +95,9 @@ test('SolaX applied-target readback refreshes only from actual poll, never write
94
95
  let now = 1000000;
95
96
  t.mock.method(Date, 'now', () => now);
96
97
  const { runtime, writes } = createRuntime('ess.solax.SolaXHybridX1X3Ess');
97
- await runtime._updateAliases({ sET_ACTIVE_POWER: 900 }, { connected: true });
98
+ const actual = { sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 900 };
99
+ recordReadResponse(actual, Object.keys(actual));
100
+ await runtime._updateAliases(actual, { connected: true });
98
101
  const path = '.aliases.v1.r.powerSetpointReadbackW';
99
102
  now += 5000;
100
103
  await runtime._ackWrittenValue(runtime.dpById.get('sET_ACTIVE_POWER'), 1200);
@@ -102,7 +105,9 @@ test('SolaX applied-target readback refreshes only from actual poll, never write
102
105
  assert.equal(lastWrite(writes, path).val, 900);
103
106
  await runtime._updateAliases({ bMS1_SOC: 55 }, { connected: true });
104
107
  assert.equal(lastWrite(writes, path).ts, 1000000);
105
- await runtime._updateAliases({ sET_ACTIVE_POWER: 900 }, { connected: true });
108
+ const nextActual = { sET_CONTROL_MODE: 4, sET_ACTIVE_POWER: 900 };
109
+ recordReadResponse(nextActual, Object.keys(nextActual));
110
+ await runtime._updateAliases(nextActual, { connected: true });
106
111
  assert.equal(lastWrite(writes, path).ts, now);
107
112
  });
108
113
 
@@ -0,0 +1,148 @@
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 ModbusRTU = require('modbus-serial');
7
+ const { ModbusDriver } = require('../lib/drivers/modbus');
8
+ const { guardDriver } = require('../operation-guard');
9
+ const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
10
+ const deferred = () => { let resolve; const promise = new Promise(done => { resolve = done; }); return { promise, resolve }; };
11
+ async function until(predicate) { for (let i = 0; i < 200; i++) { if (predicate()) return; await wait(5); } assert.fail('TCP lifecycle milestone missing'); }
12
+
13
+ async function fixture(t) {
14
+ const connections = []; const sockets = new Set(); const requests = []; const logs = [];
15
+ const server = net.createServer(socket => {
16
+ connections.push(socket); sockets.add(socket); socket.on('close', () => sockets.delete(socket));
17
+ socket.on('data', data => requests.push(Buffer.from(data)));
18
+ });
19
+ await new Promise((resolve, reject) => { server.once('error', reject); server.listen(0, '127.0.0.1', resolve); });
20
+ let allowed = true;
21
+ const adapter = { log: Object.fromEntries(['debug', 'info', 'warn', 'error'].map(level => [level, message => logs.push({ level, message })])) };
22
+ const driver = guardDriver(new ModbusDriver(adapter, {
23
+ id: 'connect-lifecycle', protocol: 'modbusTcp',
24
+ connection: { host: '127.0.0.1', port: server.address().port, unitId: 1 },
25
+ }, { id: 'generic.connect-lifecycle', datapoints: [] }, {}), () => allowed);
26
+ t.after(async () => { await driver.disconnect(); for (const socket of sockets) socket.destroy(); await new Promise(resolve => server.close(resolve)); });
27
+ return { driver, connections, requests, logs, allow: value => { allowed = value; } };
28
+ }
29
+
30
+ // These cases use the actual modbus-serial TCP transport and a real loopback
31
+ // listener. Only timing and authorization transitions are deliberately controlled.
32
+ test('disconnect during reconnect backoff prevents an old hosted connect opening a socket after stop', async t => {
33
+ const h = await fixture(t); h.driver._nextConnectAt = Date.now() + 250;
34
+ const pending = h.driver.connect(); const rejected = assert.rejects(pending, { code: 'E_MODBUS_CONNECT_CANCELLED' });
35
+ await wait(20); h.allow(false); await h.driver.disconnect();
36
+ await rejected;
37
+ assert.equal(h.connections.length, 0); assert.equal(h.driver.connected, false); assert.equal(h.driver.client, null);
38
+ });
39
+
40
+ test('lease loss during reconnect backoff blocks TCP dispatch and a subsequent authorized attempt still works', async t => {
41
+ const h = await fixture(t); h.driver._nextConnectAt = Date.now() + 200;
42
+ const rejected = assert.rejects(h.driver.connect(), { code: 'EOS_DEVICES_NOT_AUTHORIZED' });
43
+ await wait(20); h.allow(false); await rejected;
44
+ assert.equal(h.connections.length, 0); assert.equal(h.driver.connected, false);
45
+ h.allow(true); h.driver._nextConnectAt = 0; await h.driver.connect();
46
+ assert.equal(h.connections.length, 1); assert.equal(h.driver.connected, true); assert.equal(h.driver.connecting, false);
47
+ });
48
+
49
+ test('late old backoff cannot close or change a replacement connection, even after authorization returns', async t => {
50
+ const h = await fixture(t); h.driver._nextConnectAt = Date.now() + 250;
51
+ const rejected = assert.rejects(h.driver.connect(), { code: 'E_MODBUS_CONNECT_CANCELLED' });
52
+ await wait(20); await h.driver.disconnect(); h.driver._nextConnectAt = 0;
53
+ await h.driver.connect(); const replacement = h.driver.client;
54
+ await rejected;
55
+ assert.equal(h.connections.length, 1); assert.equal(h.driver.client, replacement);
56
+ assert.equal(h.driver.connected, true); assert.equal(h.driver._isTcpOpen(), true);
57
+ assert.equal(h.requests.length, 0, 'connection lifecycle tests must not issue actuator writes');
58
+ });
59
+
60
+ test('a cancelled old ensureConnected caller cannot mark the replacement connection offline', async t => {
61
+ const h = await fixture(t); h.driver._nextConnectAt = Date.now() + 250;
62
+ const rejected = assert.rejects(h.driver.ensureConnected(), { code: 'E_MODBUS_CONNECT_CANCELLED' });
63
+ await wait(20); await h.driver.disconnect(); h.driver._nextConnectAt = 0;
64
+ await h.driver.ensureConnected(); const replacement = h.driver.client;
65
+ await rejected;
66
+ assert.equal(h.connections.length, 1); assert.equal(h.driver.client, replacement);
67
+ assert.equal(h.driver.connected, true); assert.equal(h.driver._isTcpOpen(), true);
68
+ });
69
+
70
+ test('late real TCP connection completion cannot invalidate the replacement client', async t => {
71
+ const h = await fixture(t); const held = deferred(); let callbacks = 0; let waiting = false;
72
+ const original = ModbusRTU.prototype.connectTCP;
73
+ t.mock.method(ModbusRTU.prototype, 'connectTCP', function (host, options, callback) {
74
+ return original.call(this, host, options, error => {
75
+ callbacks++;
76
+ if (callbacks === 1) { waiting = true; void held.promise.then(() => callback(error)); }
77
+ else callback(error);
78
+ });
79
+ });
80
+ t.after(() => held.resolve());
81
+ const rejected = assert.rejects(h.driver.connect(), { code: 'E_MODBUS_CONNECT_CANCELLED' });
82
+ await until(() => waiting); await h.driver.disconnect();
83
+ await h.driver.connect(); const replacement = h.driver.client;
84
+ held.resolve(); await rejected;
85
+ assert.equal(h.connections.length, 2); assert.equal(h.driver.client, replacement);
86
+ assert.equal(h.driver.connected, true); assert.equal(h.driver._isTcpOpen(), true);
87
+ });
88
+
89
+ test('concurrent callers still share one TCP connection while no disconnect occurs', async t => {
90
+ const h = await fixture(t); h.driver._nextConnectAt = Date.now() + 80;
91
+ await Promise.all([h.driver.connect(), h.driver.connect(), h.driver.ensureConnected()]);
92
+ assert.equal(h.connections.length, 1); assert.equal(h.driver.connected, true);
93
+ });
94
+
95
+ test('authorization loss inside optional SunSpec discovery is not reported as successful connection', async t => {
96
+ const h = await fixture(t);
97
+ h.driver._maybeDiscoverSunSpec = async () => { h.allow(false); throw Object.assign(new Error('EOS_DEVICES_NOT_AUTHORIZED'), { code: 'EOS_DEVICES_NOT_AUTHORIZED' }); };
98
+ await assert.rejects(h.driver.connect(), { code: 'EOS_DEVICES_NOT_AUTHORIZED' });
99
+ assert.equal(h.driver.connected, false); assert.equal(h.driver.client, null);
100
+ assert.equal(h.logs.some(row => row.message.includes('SunSpec discovery error')), false);
101
+ });
102
+
103
+ test('actual interrupted SunSpec discovery stays retryable and does not cache an unverified unit', async t => {
104
+ const h = await fixture(t); const driver = h.driver;
105
+ driver._autoSunSpec = true; driver._sunSpecScanBases = [40000]; driver._sunSpecScanFcs = [3];
106
+ let calls = 0; let rejectFirst = true;
107
+ driver._mbReadHoldingRegisters = async () => { calls++; if (rejectFirst) throw Object.assign(new Error('EOS_DEVICES_NOT_AUTHORIZED'), { code: 'EOS_DEVICES_NOT_AUTHORIZED' }); return { data: [0x5375, 0x6e53] }; };
108
+ const originalUnitId = driver.unitId;
109
+ await assert.rejects(driver._maybeDiscoverSunSpec(), { code: 'EOS_DEVICES_NOT_AUTHORIZED' });
110
+ assert.equal(driver._sunSpecDiscovered, false); assert.equal(driver.unitId, originalUnitId);
111
+ rejectFirst = false; assert.equal(await driver._maybeDiscoverSunSpec(), true);
112
+ assert.equal(calls, 2); assert.equal(driver._sunSpecFoundBase, 40000); assert.equal(driver._sunSpecDiscovered, true);
113
+ });
114
+
115
+ test('late actual SunSpec probe cannot mutate replacement metadata or timeout', async t => {
116
+ const h = await fixture(t); const driver = h.driver; const held = deferred();
117
+ driver._autoSunSpec = true; driver._sunSpecScanBases = [40000]; driver._sunSpecScanFcs = [3];
118
+ driver._mbReadHoldingRegisters = async () => held.promise;
119
+ const rejected = assert.rejects(driver._maybeDiscoverSunSpec(), { code: 'E_MODBUS_CONNECT_CANCELLED' });
120
+ await wait(5); await driver.disconnect();
121
+ const timeouts = []; const replacement = { setTimeout: value => timeouts.push(value), close() {} };
122
+ driver.client = replacement; driver.unitId = 17; driver.autoUnitId = 17;
123
+ driver._sunSpecFoundBase = 1; driver.wordOrder = 'le';
124
+ held.resolve({ data: [0x5375, 0x6e53] }); await rejected;
125
+ assert.equal(driver.client, replacement); assert.equal(driver.unitId, 17); assert.equal(driver.autoUnitId, 17);
126
+ assert.equal(driver._sunSpecFoundBase, 1); assert.equal(driver.wordOrder, 'le'); assert.deepEqual(timeouts, []);
127
+ assert.equal(driver._sunSpecDiscovered, false);
128
+ });
129
+
130
+ test('concurrent SunSpec discovery shares a single current-generation probe', async t => {
131
+ const h = await fixture(t); const driver = h.driver; const held = deferred(); let calls = 0;
132
+ driver._autoSunSpec = true; driver._sunSpecScanBases = [40000]; driver._sunSpecScanFcs = [3];
133
+ driver._mbReadHoldingRegisters = async () => { calls++; return held.promise; };
134
+ const a = driver._maybeDiscoverSunSpec(); const b = driver._maybeDiscoverSunSpec();
135
+ await wait(5); assert.equal(calls, 1); held.resolve({ data: [0x5375, 0x6e53] });
136
+ assert.deepEqual(await Promise.all([a, b]), [true, true]); assert.equal(calls, 1);
137
+ });
138
+
139
+ test('late model-map response cannot overwrite the replacement generation cache', async t => {
140
+ const h = await fixture(t); const driver = h.driver; const held = deferred();
141
+ driver._autoSunSpec = true; driver._sunSpecDiscovered = true;
142
+ driver._mbReadHoldingRegisters = async () => held.promise;
143
+ const rejected = assert.rejects(driver._maybeScanSunSpecModels(), { code: 'E_MODBUS_CONNECT_CANCELLED' });
144
+ await wait(5); await driver.disconnect();
145
+ const replacementMap = new Map([[103, [{ offset: 9, len: 8 }]]]); driver._sunSpecModelsById = replacementMap; driver._sunSpecModelsScanned = false;
146
+ held.resolve({ data: [0xffff, 0] }); await rejected;
147
+ assert.equal(driver._sunSpecModelsById, replacementMap); assert.equal(driver._sunSpecModelsScanned, false);
148
+ });
@@ -0,0 +1,91 @@
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 fs = require('node:fs');
6
+ const path = require('node:path');
7
+ const vm = require('node:vm');
8
+ const { EventEmitter } = require('node:events');
9
+ const { createRequire } = require('node:module');
10
+ const tick = () => new Promise(resolve => setImmediate(resolve));
11
+ let nextPath = 0;
12
+ function fixture() {
13
+ const instances = [], logs = [];
14
+ class Port extends EventEmitter {
15
+ constructor() { super(); this.isOpen = false; this.openCallback = null; this.closeCallback = null; instances.push(this); }
16
+ open(callback) { this.openCallback = callback; }
17
+ connectRTUBuffered(_path, _options, callback) { this.open(callback); }
18
+ close(callback) { this.closeCallback = callback; }
19
+ finishOpen() { this.isOpen = true; const callback = this.openCallback; this.openCallback = null; callback(); }
20
+ finishClose(error) { if (!error) this.isOpen = false; const callback = this.closeCallback; this.closeCallback = null; callback(error); }
21
+ }
22
+ function load(name) {
23
+ const file = path.resolve(__dirname, '../lib/drivers', name + '.js');
24
+ const localRequire = createRequire(file), moduleValue = { exports: {} };
25
+ vm.runInNewContext(fs.readFileSync(file, 'utf8'), {
26
+ module: moduleValue, exports: moduleValue.exports, Buffer, setTimeout, clearTimeout,
27
+ require(id) {
28
+ if (id === 'modbus-serial') return Port;
29
+ if (id === 'serialport') return { SerialPort: Port };
30
+ return localRequire(id);
31
+ },
32
+ }, { filename: file });
33
+ return moduleValue.exports;
34
+ }
35
+ return { rtu: load('modbusRtuBus'), ascii: load('modbusAsciiBus'), instances,
36
+ opts: { path: '/fixture/serial-review-' + ++nextPath, baudRate: 9600 },
37
+ adapter: { log: { info() {}, warn: value => logs.push(value) } }, logs };
38
+ }
39
+ for (const type of ['rtu', 'ascii']) {
40
+ test(`${type}: identical device settings share one bus and an intermediate release cannot close it`, async () => {
41
+ const f = fixture(), api = f[type];
42
+ const a = api.acquireBus(f.adapter, f.opts), b = api.acquireBus(f.adapter, f.opts);
43
+ assert.equal(a.bus, b.bus);
44
+ const starting = a.bus.ensureConnected(); await tick(); f.instances[0].finishOpen(); await starting;
45
+ await api.releaseBus(a.key); assert.equal(f.instances[0].closeCallback, null);
46
+ assert.equal(b.bus.connected, true);
47
+ const stopping = api.releaseBus(b.key); await tick();
48
+ f.instances[0].finishClose(); await stopping;
49
+ });
50
+ test(`${type}: final release waits for a pending open and close callback; replacement stays fenced`, async () => {
51
+ const f = fixture(), api = f[type];
52
+ const first = api.acquireBus(f.adapter, f.opts);
53
+ const opening = first.bus.ensureConnected();
54
+ const cancelled = assert.rejects(opening, { code: 'E_MODBUS_SERIAL_CLOSING' });
55
+ await tick(); let stopped = false;
56
+ const closing = api.releaseBus(first.key).then(() => { stopped = true; });
57
+ assert.throws(() => api.acquireBus(f.adapter, f.opts), { code: 'E_MODBUS_SERIAL_CLOSING' });
58
+ assert.throws(() => api.acquireBus(f.adapter, { ...f.opts, baudRate: 19200 }), { code: 'E_MODBUS_SERIAL_PORT_BUSY' });
59
+ assert.equal(stopped, false); assert.equal(f.instances[0].closeCallback, null);
60
+ f.instances[0].finishOpen(); await cancelled; await tick();
61
+ assert.equal(stopped, false); assert.ok(f.instances[0].closeCallback);
62
+ f.instances[0].finishClose(); await closing;
63
+ const next = api.acquireBus(f.adapter, f.opts); assert.notEqual(next.bus, first.bus);
64
+ await api.releaseBus(next.key);
65
+ });
66
+ test(`${type}: close failure cannot release the port or start a second bus`, async () => {
67
+ const f = fixture(), api = f[type], first = api.acquireBus(f.adapter, f.opts);
68
+ const opening = first.bus.ensureConnected(); await tick(); f.instances[0].finishOpen(); await opening;
69
+ const rejected = assert.rejects(api.releaseBus(first.key), /fixture close failure/); await tick();
70
+ f.instances[0].finishClose(new Error('fixture close failure')); await rejected;
71
+ assert.throws(() => api.acquireBus(f.adapter, f.opts), { code: 'E_MODBUS_SERIAL_CLOSING' });
72
+ assert.throws(() => f[type === 'rtu' ? 'ascii' : 'rtu'].acquireBus(f.adapter, f.opts), { code: 'E_MODBUS_SERIAL_PORT_BUSY' });
73
+ assert.deepEqual(f.logs, ['EOS_MODBUS_SERIAL_STOP_UNCONFIRMED']);
74
+ assert.equal(f.instances.length, 1);
75
+ });
76
+ test(`${type}: stalled close times out but the lease remains until genuine late confirmation`, async () => {
77
+ const f = fixture(), api = f[type], first = api.acquireBus(f.adapter, f.opts);
78
+ const opening = first.bus.ensureConnected(); await tick(); f.instances[0].finishOpen(); await opening;
79
+ await assert.rejects(api.releaseBus(first.key), { code: 'E_MODBUS_SERIAL_STOP_TIMEOUT' });
80
+ assert.throws(() => api.acquireBus(f.adapter, f.opts), { code: 'E_MODBUS_SERIAL_CLOSING' });
81
+ f.instances[0].finishClose(); await tick();
82
+ const next = api.acquireBus(f.adapter, f.opts); await api.releaseBus(next.key);
83
+ });
84
+ }
85
+ test('RTU and ASCII or different baud rates cannot own one configured path concurrently', async () => {
86
+ const f = fixture(), first = f.rtu.acquireBus(f.adapter, f.opts);
87
+ assert.throws(() => f.ascii.acquireBus(f.adapter, f.opts), { code: 'E_MODBUS_SERIAL_PORT_BUSY' });
88
+ assert.throws(() => f.rtu.acquireBus(f.adapter, { ...f.opts, baudRate: 19200 }), { code: 'E_MODBUS_SERIAL_PORT_BUSY' });
89
+ await f.rtu.releaseBus(first.key);
90
+ const second = f.ascii.acquireBus(f.adapter, f.opts); await f.ascii.releaseBus(second.key);
91
+ });
@@ -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
  });