@enyo-energy/energy-app-sdk 0.0.34

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 (330) hide show
  1. package/README.md +216 -0
  2. package/dist/cjs/connect-ems-api.cjs +2 -0
  3. package/dist/cjs/connect-ems-api.d.cts +30 -0
  4. package/dist/cjs/connect-ems-permission.enum.cjs +7 -0
  5. package/dist/cjs/connect-ems-permission.enum.d.cts +3 -0
  6. package/dist/cjs/connect-ems-permission.type.cjs +2 -0
  7. package/dist/cjs/connect-ems-permission.type.d.cts +1 -0
  8. package/dist/cjs/connect-package-definition.cjs +14 -0
  9. package/dist/cjs/connect-package-definition.d.cts +57 -0
  10. package/dist/cjs/energy-app-appliance-type.enum.cjs +14 -0
  11. package/dist/cjs/energy-app-appliance-type.enum.d.cts +10 -0
  12. package/dist/cjs/energy-app-package-configuration.cjs +2 -0
  13. package/dist/cjs/energy-app-package-configuration.d.cts +30 -0
  14. package/dist/cjs/energy-app-package-definition.cjs +30 -0
  15. package/dist/cjs/energy-app-package-definition.d.cts +123 -0
  16. package/dist/cjs/energy-app-permission.type.cjs +21 -0
  17. package/dist/cjs/energy-app-permission.type.d.cts +18 -0
  18. package/dist/cjs/enyo-energy-app-sdk.cjs +12 -0
  19. package/dist/cjs/enyo-energy-app-sdk.d.cts +67 -0
  20. package/dist/cjs/hems-one-energy-app-sdk.cjs +12 -0
  21. package/dist/cjs/hems-one-energy-app-sdk.d.cts +64 -0
  22. package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.cjs +388 -0
  23. package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.d.cts +59 -0
  24. package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.cjs +37 -0
  25. package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.d.cts +15 -0
  26. package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.cjs +130 -0
  27. package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.d.cts +41 -0
  28. package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.cjs +49 -0
  29. package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.cts +10 -0
  30. package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.cjs +348 -0
  31. package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.d.cts +56 -0
  32. package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.cjs +199 -0
  33. package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.d.cts +26 -0
  34. package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.cjs +98 -0
  35. package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.d.cts +13 -0
  36. package/dist/cjs/implementations/modbus/interfaces.cjs +29 -0
  37. package/dist/cjs/implementations/modbus/interfaces.d.cts +202 -0
  38. package/dist/cjs/implementations/ocpp/ocpp-common.cjs +337 -0
  39. package/dist/cjs/implementations/ocpp/ocpp-common.d.cts +75 -0
  40. package/dist/cjs/implementations/ocpp/ocpp16.cjs +51 -0
  41. package/dist/cjs/implementations/ocpp/ocpp16.d.cts +137 -0
  42. package/dist/cjs/implementations/ocpp/ocpp201.cjs +84 -0
  43. package/dist/cjs/implementations/ocpp/ocpp201.d.cts +215 -0
  44. package/dist/cjs/index.cjs +117 -0
  45. package/dist/cjs/index.d.cts +56 -0
  46. package/dist/cjs/mockConnectEmsApi.cjs +167 -0
  47. package/dist/cjs/mockConnectEmsApi.d.cts +10 -0
  48. package/dist/cjs/packages/connect-appliance.cjs +2 -0
  49. package/dist/cjs/packages/connect-appliance.d.cts +24 -0
  50. package/dist/cjs/packages/connect-http-api.cjs +2 -0
  51. package/dist/cjs/packages/connect-http-api.d.cts +15 -0
  52. package/dist/cjs/packages/connect-interval.cjs +2 -0
  53. package/dist/cjs/packages/connect-interval.d.cts +15 -0
  54. package/dist/cjs/packages/connect-modbus.cjs +2 -0
  55. package/dist/cjs/packages/connect-modbus.d.cts +60 -0
  56. package/dist/cjs/packages/connect-network-devices.cjs +2 -0
  57. package/dist/cjs/packages/connect-network-devices.d.cts +40 -0
  58. package/dist/cjs/packages/connect-storage.cjs +2 -0
  59. package/dist/cjs/packages/connect-storage.d.cts +14 -0
  60. package/dist/cjs/packages/energy-app-appliance.cjs +2 -0
  61. package/dist/cjs/packages/energy-app-appliance.d.cts +17 -0
  62. package/dist/cjs/packages/energy-app-authentication.cjs +2 -0
  63. package/dist/cjs/packages/energy-app-authentication.d.cts +52 -0
  64. package/dist/cjs/packages/energy-app-charge.cjs +2 -0
  65. package/dist/cjs/packages/energy-app-charge.d.cts +13 -0
  66. package/dist/cjs/packages/energy-app-charging-card.cjs +2 -0
  67. package/dist/cjs/packages/energy-app-charging-card.d.cts +11 -0
  68. package/dist/cjs/packages/energy-app-data-bus.cjs +2 -0
  69. package/dist/cjs/packages/energy-app-data-bus.d.cts +12 -0
  70. package/dist/cjs/packages/energy-app-electricity-prices.cjs +2 -0
  71. package/dist/cjs/packages/energy-app-electricity-prices.d.cts +59 -0
  72. package/dist/cjs/packages/energy-app-interval.cjs +2 -0
  73. package/dist/cjs/packages/energy-app-interval.d.cts +15 -0
  74. package/dist/cjs/packages/energy-app-modbus.cjs +2 -0
  75. package/dist/cjs/packages/energy-app-modbus.d.cts +46 -0
  76. package/dist/cjs/packages/energy-app-network-device.cjs +2 -0
  77. package/dist/cjs/packages/energy-app-network-device.d.cts +25 -0
  78. package/dist/cjs/packages/energy-app-notification.cjs +2 -0
  79. package/dist/cjs/packages/energy-app-notification.d.cts +50 -0
  80. package/dist/cjs/packages/energy-app-ocpp.cjs +16 -0
  81. package/dist/cjs/packages/energy-app-ocpp.d.cts +52 -0
  82. package/dist/cjs/packages/energy-app-settings.cjs +2 -0
  83. package/dist/cjs/packages/energy-app-settings.d.cts +47 -0
  84. package/dist/cjs/packages/energy-app-storage.cjs +2 -0
  85. package/dist/cjs/packages/energy-app-storage.d.cts +14 -0
  86. package/dist/cjs/packages/energy-app-vehicle.cjs +2 -0
  87. package/dist/cjs/packages/energy-app-vehicle.d.cts +11 -0
  88. package/dist/cjs/permission-not-granted.cjs +18 -0
  89. package/dist/cjs/permission-not-granted.d.cts +8 -0
  90. package/dist/cjs/types/connect-appliance-type.enum.cjs +10 -0
  91. package/dist/cjs/types/connect-appliance-type.enum.d.cts +6 -0
  92. package/dist/cjs/types/energy-app-settings.cjs +2 -0
  93. package/dist/cjs/types/energy-app-settings.d.cts +74 -0
  94. package/dist/cjs/types/enyo-appliance.cjs +33 -0
  95. package/dist/cjs/types/enyo-appliance.d.cts +81 -0
  96. package/dist/cjs/types/enyo-authentication.cjs +9 -0
  97. package/dist/cjs/types/enyo-authentication.d.cts +69 -0
  98. package/dist/cjs/types/enyo-battery-appliance.cjs +2 -0
  99. package/dist/cjs/types/enyo-battery-appliance.d.cts +6 -0
  100. package/dist/cjs/types/enyo-charge.cjs +15 -0
  101. package/dist/cjs/types/enyo-charge.d.cts +82 -0
  102. package/dist/cjs/types/enyo-charger-appliance.cjs +41 -0
  103. package/dist/cjs/types/enyo-charger-appliance.d.cts +49 -0
  104. package/dist/cjs/types/enyo-charging-card.cjs +2 -0
  105. package/dist/cjs/types/enyo-charging-card.d.cts +11 -0
  106. package/dist/cjs/types/enyo-data-bus-value.cjs +78 -0
  107. package/dist/cjs/types/enyo-data-bus-value.d.cts +379 -0
  108. package/dist/cjs/types/enyo-electricity-prices.cjs +2 -0
  109. package/dist/cjs/types/enyo-electricity-prices.d.cts +63 -0
  110. package/dist/cjs/types/enyo-energy-tariff.cjs +2 -0
  111. package/dist/cjs/types/enyo-energy-tariff.d.cts +70 -0
  112. package/dist/cjs/types/enyo-heatpump-appliance.cjs +19 -0
  113. package/dist/cjs/types/enyo-heatpump-appliance.d.cts +34 -0
  114. package/dist/cjs/types/enyo-inverter-appliance.cjs +2 -0
  115. package/dist/cjs/types/enyo-inverter-appliance.d.cts +3 -0
  116. package/dist/cjs/types/enyo-meter-appliance.cjs +10 -0
  117. package/dist/cjs/types/enyo-meter-appliance.d.cts +10 -0
  118. package/dist/cjs/types/enyo-network-device.cjs +2 -0
  119. package/dist/cjs/types/enyo-network-device.d.cts +31 -0
  120. package/dist/cjs/types/enyo-notification.cjs +2 -0
  121. package/dist/cjs/types/enyo-notification.d.cts +48 -0
  122. package/dist/cjs/types/enyo-settings.cjs +2 -0
  123. package/dist/cjs/types/enyo-settings.d.cts +74 -0
  124. package/dist/cjs/types/enyo-source.enum.cjs +8 -0
  125. package/dist/cjs/types/enyo-source.enum.d.cts +4 -0
  126. package/dist/cjs/types/enyo-vehicle.cjs +2 -0
  127. package/dist/cjs/types/enyo-vehicle.d.cts +12 -0
  128. package/dist/cjs/types/enyo-websocket-connection.cjs +2 -0
  129. package/dist/cjs/types/enyo-websocket-connection.d.cts +8 -0
  130. package/dist/cjs/types/hems-one-appliance.cjs +33 -0
  131. package/dist/cjs/types/hems-one-appliance.d.cts +81 -0
  132. package/dist/cjs/types/hems-one-authentication.cjs +9 -0
  133. package/dist/cjs/types/hems-one-authentication.d.cts +69 -0
  134. package/dist/cjs/types/hems-one-battery-appliance.cjs +2 -0
  135. package/dist/cjs/types/hems-one-battery-appliance.d.cts +6 -0
  136. package/dist/cjs/types/hems-one-charge.cjs +15 -0
  137. package/dist/cjs/types/hems-one-charge.d.cts +82 -0
  138. package/dist/cjs/types/hems-one-charger-appliance.cjs +41 -0
  139. package/dist/cjs/types/hems-one-charger-appliance.d.cts +49 -0
  140. package/dist/cjs/types/hems-one-charging-card.cjs +2 -0
  141. package/dist/cjs/types/hems-one-charging-card.d.cts +11 -0
  142. package/dist/cjs/types/hems-one-data-bus-command.cjs +9 -0
  143. package/dist/cjs/types/hems-one-data-bus-command.d.cts +34 -0
  144. package/dist/cjs/types/hems-one-data-bus-value.cjs +78 -0
  145. package/dist/cjs/types/hems-one-data-bus-value.d.cts +379 -0
  146. package/dist/cjs/types/hems-one-electricity-prices.cjs +2 -0
  147. package/dist/cjs/types/hems-one-electricity-prices.d.cts +63 -0
  148. package/dist/cjs/types/hems-one-energy-tariff.cjs +2 -0
  149. package/dist/cjs/types/hems-one-energy-tariff.d.cts +70 -0
  150. package/dist/cjs/types/hems-one-heatpump-appliance.cjs +19 -0
  151. package/dist/cjs/types/hems-one-heatpump-appliance.d.cts +34 -0
  152. package/dist/cjs/types/hems-one-inverter-appliance.cjs +2 -0
  153. package/dist/cjs/types/hems-one-inverter-appliance.d.cts +3 -0
  154. package/dist/cjs/types/hems-one-meter-appliance.cjs +10 -0
  155. package/dist/cjs/types/hems-one-meter-appliance.d.cts +10 -0
  156. package/dist/cjs/types/hems-one-network-device.cjs +2 -0
  157. package/dist/cjs/types/hems-one-network-device.d.cts +31 -0
  158. package/dist/cjs/types/hems-one-source.enum.cjs +8 -0
  159. package/dist/cjs/types/hems-one-source.enum.d.cts +4 -0
  160. package/dist/cjs/types/hems-one-vehicle.cjs +2 -0
  161. package/dist/cjs/types/hems-one-vehicle.d.cts +12 -0
  162. package/dist/cjs/types/hems-one-websocket-connection.cjs +2 -0
  163. package/dist/cjs/types/hems-one-websocket-connection.d.cts +8 -0
  164. package/dist/cjs/version.cjs +19 -0
  165. package/dist/cjs/version.d.cts +13 -0
  166. package/dist/connect-ems-api.d.ts +30 -0
  167. package/dist/connect-ems-api.js +1 -0
  168. package/dist/connect-ems-permission.enum.d.ts +3 -0
  169. package/dist/connect-ems-permission.enum.js +4 -0
  170. package/dist/connect-ems-permission.type.d.ts +1 -0
  171. package/dist/connect-ems-permission.type.js +1 -0
  172. package/dist/connect-package-definition.d.ts +57 -0
  173. package/dist/connect-package-definition.js +10 -0
  174. package/dist/energy-app-appliance-type.enum.d.ts +10 -0
  175. package/dist/energy-app-appliance-type.enum.js +11 -0
  176. package/dist/energy-app-package-configuration.d.ts +30 -0
  177. package/dist/energy-app-package-configuration.js +1 -0
  178. package/dist/energy-app-package-definition.d.ts +123 -0
  179. package/dist/energy-app-package-definition.js +26 -0
  180. package/dist/energy-app-permission.type.d.ts +18 -0
  181. package/dist/energy-app-permission.type.js +18 -0
  182. package/dist/enyo-energy-app-sdk.d.ts +67 -0
  183. package/dist/enyo-energy-app-sdk.js +9 -0
  184. package/dist/hems-one-energy-app-sdk.d.ts +67 -0
  185. package/dist/hems-one-energy-app-sdk.js +9 -0
  186. package/dist/implementations/modbus/EnergyAppModbusBattery.d.ts +59 -0
  187. package/dist/implementations/modbus/EnergyAppModbusBattery.js +384 -0
  188. package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.d.ts +15 -0
  189. package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.js +33 -0
  190. package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.d.ts +41 -0
  191. package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.js +126 -0
  192. package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.ts +10 -0
  193. package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.js +45 -0
  194. package/dist/implementations/modbus/EnergyAppModbusInverter.d.ts +56 -0
  195. package/dist/implementations/modbus/EnergyAppModbusInverter.js +344 -0
  196. package/dist/implementations/modbus/EnergyAppModbusMeter.d.ts +26 -0
  197. package/dist/implementations/modbus/EnergyAppModbusMeter.js +195 -0
  198. package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.d.ts +13 -0
  199. package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.js +94 -0
  200. package/dist/implementations/modbus/interfaces.d.ts +202 -0
  201. package/dist/implementations/modbus/interfaces.js +23 -0
  202. package/dist/implementations/ocpp/ocpp-common.d.ts +75 -0
  203. package/dist/implementations/ocpp/ocpp-common.js +328 -0
  204. package/dist/implementations/ocpp/ocpp16.d.ts +137 -0
  205. package/dist/implementations/ocpp/ocpp16.js +48 -0
  206. package/dist/implementations/ocpp/ocpp201.d.ts +215 -0
  207. package/dist/implementations/ocpp/ocpp201.js +81 -0
  208. package/dist/index.d.ts +56 -0
  209. package/dist/index.js +99 -0
  210. package/dist/mockConnectEmsApi.d.ts +10 -0
  211. package/dist/mockConnectEmsApi.js +160 -0
  212. package/dist/packages/connect-appliance.d.ts +24 -0
  213. package/dist/packages/connect-appliance.js +1 -0
  214. package/dist/packages/connect-http-api.d.ts +15 -0
  215. package/dist/packages/connect-http-api.js +1 -0
  216. package/dist/packages/connect-interval.d.ts +15 -0
  217. package/dist/packages/connect-interval.js +1 -0
  218. package/dist/packages/connect-modbus.d.ts +60 -0
  219. package/dist/packages/connect-modbus.js +1 -0
  220. package/dist/packages/connect-network-devices.d.ts +40 -0
  221. package/dist/packages/connect-network-devices.js +1 -0
  222. package/dist/packages/connect-storage.d.ts +14 -0
  223. package/dist/packages/connect-storage.js +1 -0
  224. package/dist/packages/energy-app-appliance.d.ts +17 -0
  225. package/dist/packages/energy-app-appliance.js +1 -0
  226. package/dist/packages/energy-app-authentication.d.ts +52 -0
  227. package/dist/packages/energy-app-authentication.js +1 -0
  228. package/dist/packages/energy-app-charge.d.ts +13 -0
  229. package/dist/packages/energy-app-charge.js +1 -0
  230. package/dist/packages/energy-app-charging-card.d.ts +11 -0
  231. package/dist/packages/energy-app-charging-card.js +1 -0
  232. package/dist/packages/energy-app-data-bus.d.ts +12 -0
  233. package/dist/packages/energy-app-data-bus.js +1 -0
  234. package/dist/packages/energy-app-electricity-prices.d.ts +59 -0
  235. package/dist/packages/energy-app-electricity-prices.js +1 -0
  236. package/dist/packages/energy-app-interval.d.ts +15 -0
  237. package/dist/packages/energy-app-interval.js +1 -0
  238. package/dist/packages/energy-app-modbus.d.ts +46 -0
  239. package/dist/packages/energy-app-modbus.js +1 -0
  240. package/dist/packages/energy-app-network-device.d.ts +25 -0
  241. package/dist/packages/energy-app-network-device.js +1 -0
  242. package/dist/packages/energy-app-notification.d.ts +50 -0
  243. package/dist/packages/energy-app-notification.js +1 -0
  244. package/dist/packages/energy-app-ocpp.d.ts +52 -0
  245. package/dist/packages/energy-app-ocpp.js +13 -0
  246. package/dist/packages/energy-app-settings.d.ts +47 -0
  247. package/dist/packages/energy-app-settings.js +1 -0
  248. package/dist/packages/energy-app-storage.d.ts +14 -0
  249. package/dist/packages/energy-app-storage.js +1 -0
  250. package/dist/packages/energy-app-vehicle.d.ts +11 -0
  251. package/dist/packages/energy-app-vehicle.js +1 -0
  252. package/dist/permission-not-granted.d.ts +8 -0
  253. package/dist/permission-not-granted.js +14 -0
  254. package/dist/types/connect-appliance-type.enum.d.ts +6 -0
  255. package/dist/types/connect-appliance-type.enum.js +7 -0
  256. package/dist/types/energy-app-settings.d.ts +74 -0
  257. package/dist/types/energy-app-settings.js +1 -0
  258. package/dist/types/enyo-appliance.d.ts +81 -0
  259. package/dist/types/enyo-appliance.js +30 -0
  260. package/dist/types/enyo-authentication.d.ts +69 -0
  261. package/dist/types/enyo-authentication.js +6 -0
  262. package/dist/types/enyo-battery-appliance.d.ts +6 -0
  263. package/dist/types/enyo-battery-appliance.js +1 -0
  264. package/dist/types/enyo-charge.d.ts +82 -0
  265. package/dist/types/enyo-charge.js +12 -0
  266. package/dist/types/enyo-charger-appliance.d.ts +49 -0
  267. package/dist/types/enyo-charger-appliance.js +38 -0
  268. package/dist/types/enyo-charging-card.d.ts +11 -0
  269. package/dist/types/enyo-charging-card.js +1 -0
  270. package/dist/types/enyo-data-bus-value.d.ts +379 -0
  271. package/dist/types/enyo-data-bus-value.js +75 -0
  272. package/dist/types/enyo-electricity-prices.d.ts +63 -0
  273. package/dist/types/enyo-electricity-prices.js +1 -0
  274. package/dist/types/enyo-energy-tariff.d.ts +70 -0
  275. package/dist/types/enyo-energy-tariff.js +1 -0
  276. package/dist/types/enyo-heatpump-appliance.d.ts +34 -0
  277. package/dist/types/enyo-heatpump-appliance.js +16 -0
  278. package/dist/types/enyo-inverter-appliance.d.ts +3 -0
  279. package/dist/types/enyo-inverter-appliance.js +1 -0
  280. package/dist/types/enyo-meter-appliance.d.ts +10 -0
  281. package/dist/types/enyo-meter-appliance.js +7 -0
  282. package/dist/types/enyo-network-device.d.ts +31 -0
  283. package/dist/types/enyo-network-device.js +1 -0
  284. package/dist/types/enyo-notification.d.ts +48 -0
  285. package/dist/types/enyo-notification.js +1 -0
  286. package/dist/types/enyo-settings.d.ts +74 -0
  287. package/dist/types/enyo-settings.js +1 -0
  288. package/dist/types/enyo-source.enum.d.ts +4 -0
  289. package/dist/types/enyo-source.enum.js +5 -0
  290. package/dist/types/enyo-vehicle.d.ts +12 -0
  291. package/dist/types/enyo-vehicle.js +1 -0
  292. package/dist/types/enyo-websocket-connection.d.ts +8 -0
  293. package/dist/types/enyo-websocket-connection.js +1 -0
  294. package/dist/types/hems-one-appliance.d.ts +81 -0
  295. package/dist/types/hems-one-appliance.js +30 -0
  296. package/dist/types/hems-one-authentication.d.ts +69 -0
  297. package/dist/types/hems-one-authentication.js +6 -0
  298. package/dist/types/hems-one-battery-appliance.d.ts +6 -0
  299. package/dist/types/hems-one-battery-appliance.js +1 -0
  300. package/dist/types/hems-one-charge.d.ts +82 -0
  301. package/dist/types/hems-one-charge.js +12 -0
  302. package/dist/types/hems-one-charger-appliance.d.ts +49 -0
  303. package/dist/types/hems-one-charger-appliance.js +38 -0
  304. package/dist/types/hems-one-charging-card.d.ts +11 -0
  305. package/dist/types/hems-one-charging-card.js +1 -0
  306. package/dist/types/hems-one-data-bus-command.d.ts +34 -0
  307. package/dist/types/hems-one-data-bus-command.js +6 -0
  308. package/dist/types/hems-one-data-bus-value.d.ts +379 -0
  309. package/dist/types/hems-one-data-bus-value.js +75 -0
  310. package/dist/types/hems-one-electricity-prices.d.ts +63 -0
  311. package/dist/types/hems-one-electricity-prices.js +1 -0
  312. package/dist/types/hems-one-energy-tariff.d.ts +70 -0
  313. package/dist/types/hems-one-energy-tariff.js +1 -0
  314. package/dist/types/hems-one-heatpump-appliance.d.ts +34 -0
  315. package/dist/types/hems-one-heatpump-appliance.js +16 -0
  316. package/dist/types/hems-one-inverter-appliance.d.ts +3 -0
  317. package/dist/types/hems-one-inverter-appliance.js +1 -0
  318. package/dist/types/hems-one-meter-appliance.d.ts +10 -0
  319. package/dist/types/hems-one-meter-appliance.js +7 -0
  320. package/dist/types/hems-one-network-device.d.ts +31 -0
  321. package/dist/types/hems-one-network-device.js +1 -0
  322. package/dist/types/hems-one-source.enum.d.ts +4 -0
  323. package/dist/types/hems-one-source.enum.js +5 -0
  324. package/dist/types/hems-one-vehicle.d.ts +12 -0
  325. package/dist/types/hems-one-vehicle.js +1 -0
  326. package/dist/types/hems-one-websocket-connection.d.ts +8 -0
  327. package/dist/types/hems-one-websocket-connection.js +1 -0
  328. package/dist/version.d.ts +13 -0
  329. package/dist/version.js +15 -0
  330. package/package.json +43 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Supported interval durations for scheduled tasks.
3
+ * Provides predefined time intervals from 1 second to 1 hour.
4
+ */
5
+ export type IntervalDuration = '1s' | '10s' | '30s' | '1m' | '5m' | '1hr';
6
+ /**
7
+ * Interface for managing scheduled intervals in Connect EMS packages.
8
+ * Provides functionality to create and manage recurring tasks.
9
+ */
10
+ export interface ConnectInterval {
11
+ /** Create a new interval that executes the callback at the specified duration */
12
+ createInterval: (duration: IntervalDuration, callback: () => void) => string;
13
+ /** Stop an existing interval by its ID */
14
+ stopInterval: (intervalId: string) => void;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Configuration options for establishing a Modbus connection.
3
+ */
4
+ export interface ModbusOptions {
5
+ /** Hostname or IP address of the Modbus server */
6
+ host: string;
7
+ /** Port number for the Modbus connection (default: 502) */
8
+ port?: number;
9
+ /** Connection timeout in milliseconds */
10
+ timeout?: number;
11
+ /** Modbus unit identifier for the target device */
12
+ unitId?: number;
13
+ }
14
+ /**
15
+ * Data structure for Modbus register operations.
16
+ */
17
+ export interface ModbusRegisterData {
18
+ /** Register address */
19
+ address: number;
20
+ /** Register value(s) - single number or array for multiple registers */
21
+ value: number | number[];
22
+ }
23
+ /**
24
+ * Data structure for Modbus coil operations.
25
+ */
26
+ export interface ModbusCoilData {
27
+ /** Coil address */
28
+ address: number;
29
+ /** Coil value(s) - single boolean or array for multiple coils */
30
+ value: boolean | boolean[];
31
+ }
32
+ /**
33
+ * Interface for Modbus TCP/IP communication in Connect EMS packages.
34
+ * Provides comprehensive Modbus client functionality for reading and writing
35
+ * coils, discrete inputs, holding registers, and input registers.
36
+ */
37
+ export interface ConnectModbus {
38
+ /** Establish connection to a Modbus server */
39
+ connect: (options: ModbusOptions) => Promise<void>;
40
+ /** Close the Modbus connection */
41
+ disconnect: () => Promise<void>;
42
+ /** Check if currently connected to a Modbus server */
43
+ isConnected: () => boolean;
44
+ /** Read coil values from the specified address range */
45
+ readCoils: (address: number, quantity: number) => Promise<boolean[]>;
46
+ /** Read discrete input values from the specified address range */
47
+ readDiscreteInputs: (address: number, quantity: number) => Promise<boolean[]>;
48
+ /** Read holding register values from the specified address range */
49
+ readHoldingRegisters: (address: number, quantity: number) => Promise<number[]>;
50
+ /** Read input register values from the specified address range */
51
+ readInputRegisters: (address: number, quantity: number) => Promise<number[]>;
52
+ /** Write a single coil value to the specified address */
53
+ writeSingleCoil: (address: number, value: boolean) => Promise<void>;
54
+ /** Write a single register value to the specified address */
55
+ writeSingleRegister: (address: number, value: number) => Promise<void>;
56
+ /** Write multiple coil values starting from the specified address */
57
+ writeMultipleCoils: (address: number, values: boolean[]) => Promise<void>;
58
+ /** Write multiple register values starting from the specified address */
59
+ writeMultipleRegisters: (address: number, values: number[]) => Promise<void>;
60
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Represents a detected network device with its connectivity information.
3
+ */
4
+ export interface NetworkDevice {
5
+ /** Unique identifier for the device */
6
+ id: string;
7
+ /** Network hostname of the device */
8
+ hostname: string;
9
+ /** IP address of the device */
10
+ ipAddress: string;
11
+ /** MAC address of the device (if available) */
12
+ macAddress?: string;
13
+ /** Whether the device is currently online */
14
+ isOnline: boolean;
15
+ /** Timestamp when the device was last seen */
16
+ lastSeen: Date;
17
+ /** List of open network ports on the device */
18
+ ports?: NetworkPort[];
19
+ }
20
+ /**
21
+ * Represents an open network port on a device.
22
+ */
23
+ export interface NetworkPort {
24
+ /** Port number */
25
+ port: number;
26
+ /** Service name running on the port (if detected) */
27
+ service?: string;
28
+ }
29
+ /**
30
+ * Interface for network device discovery and management in Connect EMS packages.
31
+ * Provides functionality to detect and interact with devices on the local network.
32
+ */
33
+ export interface ConnectNetworkDevices {
34
+ /** Get list of all previously detected network devices */
35
+ getDetectedDevices: () => Promise<NetworkDevice[]>;
36
+ /** Get a specific device by its unique ID */
37
+ getDevice: (deviceId: string) => Promise<NetworkDevice | null>;
38
+ /** Trigger an asynchronous search for new devices on the network */
39
+ searchDevices: () => Promise<NetworkDevice[]>;
40
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Interface for persistent storage operations in Connect EMS packages.
3
+ * Provides key-value storage capabilities for package data persistence.
4
+ */
5
+ export interface ConnectStorage {
6
+ /** Save an object to storage with the specified key */
7
+ save: (key: string, value: object) => Promise<void>;
8
+ /** Load an object from storage by key, returns null if not found */
9
+ load: (key: string) => Promise<object | null>;
10
+ /** Remove an object from storage by key */
11
+ remove: (key: string) => Promise<void>;
12
+ /** Returns a list of all keys stored in the storage */
13
+ listKeys: () => Promise<string[]>;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { EnyoAppliance } from "../types/enyo-appliance.js";
2
+ /**
3
+ * Interface for managing appliances in enyo packages.
4
+ * Provides CRUD operations for appliance registration and management.
5
+ */
6
+ export interface EnergyAppAppliance {
7
+ /** Save or update an appliance in the system */
8
+ save: (appliance: Omit<EnyoAppliance, 'id'>, applianceId: string | undefined) => Promise<string>;
9
+ /** Get a list of all registered appliances of your package */
10
+ list: () => Promise<EnyoAppliance[]>;
11
+ /** Get a list of all appliances. Needs a specific permission */
12
+ listAll: () => Promise<EnyoAppliance[]>;
13
+ /** Get a specific appliance by its ID */
14
+ getById: (id: string) => Promise<EnyoAppliance | null>;
15
+ /** Remove an appliance by its ID */
16
+ removeById: (id: string) => Promise<void>;
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ import { EnyoAuthenticateState, EnyoAuthentication, EnyoAuthenticationResponse, EnyoOauthAuthenticationParameters, EnyoOauthAuthenticationRedirectUrlResponse } from "../types/enyo-authentication.js";
2
+ /**
3
+ * Interface for requesting user authentication for appliances or the entire package.
4
+ * Provides methods to handle authentication requests, listen for responses, and manage authentication state.
5
+ */
6
+ export interface EnergyAppAuthentication {
7
+ /**
8
+ * Requests user authentication for an appliance or the entire package.
9
+ * The user will receive a notification to authenticate. This operation might take time.
10
+ *
11
+ * @param authentication - The authentication configuration containing type, credentials setup, and optional appliance ID
12
+ * @returns Promise that resolves to the request ID for tracking the authentication process
13
+ */
14
+ requestAuthentication(authentication: EnyoAuthentication): Promise<string>;
15
+ /**
16
+ * If you use oauth with clientIdName and clientSecretName, you need to listen to this and respond with the redirect url
17
+ */
18
+ listenForOauthParameters(listener: (response: EnyoOauthAuthenticationParameters) => Promise<EnyoOauthAuthenticationRedirectUrlResponse>): string;
19
+ /**
20
+ * Adds a listener for authentication responses.
21
+ * The listener will be called when the user completes the authentication process.
22
+ *
23
+ * @param listener - Callback function that receives the authentication response and should return the authentication state
24
+ * @returns The listener ID for removing the listener later
25
+ */
26
+ listenForAuthenticationResponse(listener: (response: EnyoAuthenticationResponse) => Promise<EnyoAuthenticateState>): string;
27
+ /**
28
+ * Removes a previously registered authentication response listener.
29
+ *
30
+ * @param listenerId - The ID of the listener to remove
31
+ */
32
+ removeListener: (listenerId: string) => void;
33
+ /**
34
+ * Adds a listener for user-initiated sign-out events.
35
+ * The listener will be called when the user manually signs out.
36
+ *
37
+ * @param listener - Callback function called when user signs out
38
+ * @returns The listener ID for removing the listener later
39
+ */
40
+ listenForSignOut(listener: () => void): string;
41
+ /**
42
+ * Gets the current authentication state.
43
+ *
44
+ * @returns Promise that resolves to the current authentication state
45
+ */
46
+ getAuthenticationState(): Promise<EnyoAuthenticateState>;
47
+ /**
48
+ * Signs the user out and updates the authentication state.
49
+ * This will trigger any registered sign-out listeners.
50
+ */
51
+ signOut(): void;
52
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { EnyoCharge, EnyoChargeFilter } from "../types/enyo-charge.js";
2
+ /**
3
+ * Interface for managing charging sessions in enyo packages.
4
+ * Provides operations for charge session tracking and management.
5
+ */
6
+ export interface EnergyAppCharge {
7
+ /** Save or update a charging session in the system */
8
+ save: (charge: Omit<EnyoCharge, 'id'>, chargeId?: string) => Promise<void>;
9
+ /** Get a list of charging sessions with optional filtering */
10
+ list: (filter?: EnyoChargeFilter) => Promise<EnyoCharge[]>;
11
+ /** Get a specific charging session by its ID */
12
+ getById: (id: string) => Promise<EnyoCharge | null>;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { EnyoChargingCard } from "../types/enyo-charging-card.js";
2
+ /**
3
+ * Interface for managing charging cards in enyo packages.
4
+ * Provides read-only operations for charging card information.
5
+ */
6
+ export interface EnergyAppChargingCard {
7
+ /** Get a list of all registered charging cards */
8
+ list: () => Promise<EnyoChargingCard[]>;
9
+ /** Get a specific charging card by its ID */
10
+ getById: (id: string) => Promise<EnyoChargingCard | null>;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { EnyoDataBusMessage, EnyoDataBusMessageAnswer, EnyoDataBusMessageEnum } from "../types/enyo-data-bus-value.js";
2
+ /**
3
+ * Interface for interaction with the Data Bus to send data or listen for changes
4
+ */
5
+ export interface EnergyAppDataBus {
6
+ sendMessage: (messages: EnyoDataBusMessage[], options?: EnergyAppDataBusSendDataOptions) => void;
7
+ sendAnswer: (answer: EnyoDataBusMessageAnswer, options?: EnergyAppDataBusSendDataOptions) => void;
8
+ listenForMessages: (types: EnyoDataBusMessageEnum[], listener: (entry: EnyoDataBusMessage) => void) => string;
9
+ unsubscribe: (listenerId: string) => void;
10
+ }
11
+ export interface EnergyAppDataBusSendDataOptions {
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ import { ElectricityPriceRequest, ElectricityPriceResponse, ElectricityPriceUpdate } from "../types/enyo-electricity-prices.js";
2
+ import { EnergyTariffInfo } from "../types/enyo-energy-tariff.js";
3
+ /**
4
+ * Interface for retrieving electricity price information.
5
+ * Provides methods to get current and forecast electricity prices,
6
+ * always normalized to 15-minute intervals regardless of source data resolution.
7
+ */
8
+ export interface EnergyAppElectricityPrices {
9
+ /**
10
+ * Retrieves electricity prices for a specified time range.
11
+ * The response always contains prices in 15-minute intervals,
12
+ * interpolated from the original data source (constant, 15min, or 1hr intervals).
13
+ *
14
+ * @param request - The price request parameters including time range and optional appliance ID
15
+ * @returns Promise that resolves to electricity prices for the requested time range
16
+ */
17
+ getPrices(request: ElectricityPriceRequest): Promise<ElectricityPriceResponse>;
18
+ /**
19
+ * Retrieves the current active tariff information.
20
+ * This includes tariff metadata, provider information, and pricing structure details.
21
+ *
22
+ * @param applianceId - Optional appliance ID to get appliance-specific tariff. If omitted, returns system-wide tariff
23
+ * @returns Promise that resolves to current tariff information, or null if no tariff is configured
24
+ */
25
+ getCurrentTariff(applianceId?: string): Promise<EnergyTariffInfo | null>;
26
+ /**
27
+ * Registers a listener for real-time electricity price updates.
28
+ * The listener will be called when tariffs change, prices are updated, or new forecasts become available.
29
+ *
30
+ * @param listener - Callback function that will be called when price updates occur
31
+ * @returns Listener ID that can be used to remove the listener later
32
+ */
33
+ listenForPriceUpdates(listener: (update: ElectricityPriceUpdate) => void): string;
34
+ /**
35
+ * Removes a previously registered price update listener.
36
+ *
37
+ * @param listenerId - The ID of the listener to remove
38
+ */
39
+ removeListener(listenerId: string): void;
40
+ /**
41
+ * Retrieves the current electricity price for the current 15-minute interval.
42
+ * This is a convenience method that gets the price for "now".
43
+ *
44
+ * @param applianceId - Optional appliance ID to get appliance-specific pricing
45
+ * @returns Promise that resolves to current price information, or null if no pricing data is available
46
+ */
47
+ getCurrentPrice(applianceId?: string): Promise<ElectricityPriceEntry | null>;
48
+ }
49
+ /**
50
+ * Represents a single electricity price entry for convenience methods
51
+ */
52
+ export interface ElectricityPriceEntry {
53
+ /** Start time of this 15-minute interval in ISO format */
54
+ timestampIso: string;
55
+ /** Price per kWh for electricity consumption during this interval */
56
+ consumptionPricePerKwh: number;
57
+ /** Optional price per kWh for grid feed-in during this interval */
58
+ feedInPricePerKwh?: number;
59
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Supported interval durations for scheduled tasks.
3
+ * Provides predefined time intervals from 1 second to 1 hour.
4
+ */
5
+ export type IntervalDuration = '10s' | '30s' | '1m' | '5m' | '1hr';
6
+ /**
7
+ * Interface for managing scheduled intervals in enyo packages.
8
+ * Provides functionality to create and manage recurring tasks.
9
+ */
10
+ export interface EnergyAppInterval {
11
+ /** Create a new interval that executes the callback at the specified duration */
12
+ createInterval: (duration: IntervalDuration, callback: (clockId: string) => void) => string;
13
+ /** Stop an existing interval by its ID */
14
+ stopInterval: (intervalId: string) => void;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Configuration options for establishing a Modbus connection.
3
+ */
4
+ export interface ModbusOptions {
5
+ /** Hostname or IP address of the Modbus server */
6
+ host: string;
7
+ /** Port number for the Modbus connection (default: 502) */
8
+ port?: number;
9
+ /** Connection timeout in milliseconds */
10
+ timeout?: number;
11
+ /** Modbus unit identifier for the target device */
12
+ unitId?: number;
13
+ }
14
+ /**
15
+ * Interface for Modbus TCP/IP communication in enyo packages.
16
+ * Provides comprehensive Modbus client functionality for reading and writing
17
+ * coils, discrete inputs, holding registers, and input registers.
18
+ */
19
+ export interface EnergyAppModbus {
20
+ /** Establish connection to a Modbus server */
21
+ connect: (options: ModbusOptions) => Promise<EnergyAppModbusInstance>;
22
+ }
23
+ export interface EnergyAppModbusInstance {
24
+ /** Close the Modbus connection */
25
+ disconnect: () => Promise<void>;
26
+ /** Check if currently connected to a Modbus server */
27
+ isConnected: () => boolean;
28
+ /** Read coil values from the specified address range */
29
+ readCoils: (address: number, quantity: number) => Promise<boolean[]>;
30
+ /** Read discrete input values from the specified address range */
31
+ readDiscreteInputs: (address: number, quantity: number) => Promise<boolean[]>;
32
+ /** Read holding register values from the specified address range */
33
+ readHoldingRegisters: (address: number, quantity: number) => Promise<Buffer>;
34
+ /** Read input register values from the specified address range */
35
+ readInputRegisters: (address: number, quantity: number) => Promise<Buffer>;
36
+ /** Write a single coil value to the specified address */
37
+ writeSingleCoil: (address: number, value: boolean) => Promise<void>;
38
+ /** Write a single register value to the specified address */
39
+ writeSingleRegister: (address: number, value: number) => Promise<void>;
40
+ /** Write multiple coil values starting from the specified address */
41
+ writeMultipleCoils: (address: number, values: boolean[]) => Promise<void>;
42
+ /** Write multiple register values starting from the specified address */
43
+ writeMultipleRegisters: (address: number, values: number[]) => Promise<void>;
44
+ /** Read holding register string value */
45
+ readRegisterStringValue: (address: number, quantity: number) => Promise<string>;
46
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import { EnyoNetworkDevice, EnyoNetworkDeviceAccessStatus } from "../types/enyo-network-device.js";
2
+ /**
3
+ * Interface for network device discovery and management in enyo packages.
4
+ * Provides functionality to detect and interact with devices on the local network.
5
+ */
6
+ export interface EnergyAppNetworkDevice {
7
+ /** Get list of all previously detected network devices */
8
+ getDevices: (filter?: {
9
+ accessStatus?: EnyoNetworkDeviceAccessStatus;
10
+ }) => Promise<EnyoNetworkDevice[]>;
11
+ /** Get a specific device by its unique ID */
12
+ getDevice: (deviceId: string) => Promise<EnyoNetworkDevice | null>;
13
+ /** Trigger an asynchronous search for new devices on the network */
14
+ searchDevices: () => Promise<EnyoNetworkDevice[]>;
15
+ /** Trigger an async request to the user to accept or reject a network device access request. Ports are optional */
16
+ requestDeviceAccess: (deviceId: string, ports?: number[]) => Promise<{
17
+ status: EnyoNetworkDeviceAccessStatus;
18
+ }>;
19
+ /** listen for device access changes. Returns a listener id */
20
+ listenForDeviceAccessChange: (listener: (deviceId: string, status: EnyoNetworkDeviceAccessStatus) => void) => string;
21
+ /** listen for detected devices, based on the device definition in the energy app package definition */
22
+ listenForDetectedDevice: (listener: (detectedDevices: EnyoNetworkDevice[]) => void) => string;
23
+ /** Removes the listener */
24
+ removeListener: (listenerId: string) => void;
25
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ import { EnyoNotification, EnyoNotificationOptions, EnyoNotificationTranslation, EnyoNotificationType } from "../types/enyo-notification.js";
2
+ /**
3
+ * Interface for managing user notifications within Energy App packages.
4
+ * Provides methods to show, retrieve, and manage notifications with multi-language support.
5
+ */
6
+ export interface EnergyAppNotification {
7
+ /**
8
+ * Shows a notification to the user with multi-language support.
9
+ * The notification will be displayed according to the specified type and options.
10
+ *
11
+ * @param type - The type of notification (info, warning, error, success) determining visual style
12
+ * @param options - Configuration options including permanence, expiration, priority, and appliance association
13
+ * @param translations - Array of translated notification messages for different supported languages
14
+ * @returns Unique notification ID that can be used for tracking and removal
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const notificationId = showNotification('warning',
19
+ * { permanent: true, priority: 'high' },
20
+ * [
21
+ * { language: 'en', notification: 'Battery level is low' },
22
+ * { language: 'de', notification: 'Batteriestand ist niedrig' }
23
+ * ]
24
+ * );
25
+ * ```
26
+ */
27
+ showNotification(type: EnyoNotificationType, options: EnyoNotificationOptions, translations: EnyoNotificationTranslation[]): string;
28
+ /**
29
+ * Retrieves all currently active notifications.
30
+ * Returns notifications in chronological order (newest first) unless sorted by priority.
31
+ *
32
+ * @param applianceId - Optional appliance ID to filter notifications for a specific appliance
33
+ * @returns Array of all current notifications with complete metadata
34
+ */
35
+ getNotifications(applianceId?: string): EnyoNotification[];
36
+ /**
37
+ * Removes a specific notification from the active notification list.
38
+ * If the notification doesn't exist, this method completes silently.
39
+ *
40
+ * @param notificationId - The unique ID of the notification to remove
41
+ */
42
+ removeNotification(notificationId: string): void;
43
+ /**
44
+ * Removes all active notifications.
45
+ * This is a convenience method for clearing the entire notification queue.
46
+ *
47
+ * @param applianceId - Optional appliance ID to clear only notifications for a specific appliance
48
+ */
49
+ clearAllNotifications(applianceId?: string): void;
50
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ export interface EnyoOcppAvailableConnectionDetail {
2
+ url: string;
3
+ path: string;
4
+ host: string;
5
+ secure: boolean;
6
+ port: number;
7
+ }
8
+ export interface EnyoOcppAvailableConnectionDetails {
9
+ cloud?: EnyoOcppAvailableConnectionDetail;
10
+ local?: EnyoOcppAvailableConnectionDetail;
11
+ }
12
+ export type EnyoOCPPVersion = '1.6' | '2.0.1';
13
+ export interface EnyoOcppChargePointConnection {
14
+ chargePointId: string;
15
+ remoteAddress?: string;
16
+ protocolVersion: EnyoOCPPVersion;
17
+ }
18
+ export interface EnergyAppOcppMessageContext {
19
+ chargePointId: string;
20
+ messageId: string;
21
+ version: EnyoOCPPVersion;
22
+ timestamp: Date;
23
+ }
24
+ export declare enum EnyoOcppErrorCode {
25
+ NotImplemented = "NotImplemented",
26
+ NotSupported = "NotSupported",
27
+ InternalError = "InternalError",
28
+ ProtocolError = "ProtocolError",
29
+ SecurityError = "SecurityError",
30
+ FormationViolation = "FormationViolation",
31
+ PropertyConstraintViolation = "PropertyConstraintViolation",
32
+ OccurenceConstraintViolation = "OccurenceConstraintViolation",
33
+ TypeConstraintViolation = "TypeConstraintViolation",
34
+ GenericError = "GenericError"
35
+ }
36
+ export interface EnergyAppOcppMessageHandler<TRequest = any, TResponse = any> {
37
+ (request: TRequest, context: EnergyAppOcppMessageContext): Promise<TResponse>;
38
+ }
39
+ /**
40
+ * Interface for OCPP functionality in enyo packages.
41
+ */
42
+ export interface EnergyAppOcpp {
43
+ getAvailableConnectionDetails: () => Promise<EnyoOcppAvailableConnectionDetails>;
44
+ listenForChargePointConnected: (listener: (connection: EnyoOcppChargePointConnection) => void) => string;
45
+ listenForChargePointDisconnected: (listener: (chargePointId: string) => void) => string;
46
+ registerHandler: <TRequest, TResponse>(action: string, handler: EnergyAppOcppMessageHandler<TRequest, TResponse>, version?: EnyoOCPPVersion) => string;
47
+ sendCall: <TRequest, TResponse>(chargePointId: string, message: string, payload: TRequest, messageId?: string) => Promise<TResponse>;
48
+ getConnectedChargePoints: () => EnyoOcppChargePointConnection[];
49
+ getChargePoint: (chargePointId: string) => EnyoOcppChargePointConnection | undefined;
50
+ disconnectChargePoint: (chargePointId: string, reason?: string) => void;
51
+ unsubscribe: (id: string) => void;
52
+ }
@@ -0,0 +1,13 @@
1
+ export var EnyoOcppErrorCode;
2
+ (function (EnyoOcppErrorCode) {
3
+ EnyoOcppErrorCode["NotImplemented"] = "NotImplemented";
4
+ EnyoOcppErrorCode["NotSupported"] = "NotSupported";
5
+ EnyoOcppErrorCode["InternalError"] = "InternalError";
6
+ EnyoOcppErrorCode["ProtocolError"] = "ProtocolError";
7
+ EnyoOcppErrorCode["SecurityError"] = "SecurityError";
8
+ EnyoOcppErrorCode["FormationViolation"] = "FormationViolation";
9
+ EnyoOcppErrorCode["PropertyConstraintViolation"] = "PropertyConstraintViolation";
10
+ EnyoOcppErrorCode["OccurenceConstraintViolation"] = "OccurenceConstraintViolation";
11
+ EnyoOcppErrorCode["TypeConstraintViolation"] = "TypeConstraintViolation";
12
+ EnyoOcppErrorCode["GenericError"] = "GenericError";
13
+ })(EnyoOcppErrorCode || (EnyoOcppErrorCode = {}));
@@ -0,0 +1,47 @@
1
+ import { EnyoPackageConfigurationSetting, EnyoSettingsChangeListener, EnyoSettingConfigWithValue } from "../types/enyo-settings.js";
2
+ /**
3
+ * Interface for managing Energy App settings configuration for appliances or the entire package.
4
+ * Provides methods to add, remove, and modify settings, as well as listen for changes.
5
+ * Each setting must have a unique name across the entire configuration.
6
+ */
7
+ export interface EnergyAppSettings {
8
+ /**
9
+ * Adds a new setting configuration to the Energy App.
10
+ * The setting can be configured for a specific appliance or for the entire package.
11
+ *
12
+ * @param config - The setting configuration to add, including optional appliance ID and current value
13
+ * @returns Promise that resolves when the setting is successfully added
14
+ */
15
+ addSettingConfig(config: EnyoPackageConfigurationSetting): Promise<void>;
16
+ /**
17
+ * Removes a setting configuration from the Energy App.
18
+ * This will remove the setting regardless of whether it's for an appliance or the package.
19
+ *
20
+ * @param settingName - The unique name of the setting to remove
21
+ * @returns Promise that resolves when the setting is successfully removed
22
+ */
23
+ removeSettingConfig(settingName: string): Promise<void>;
24
+ /**
25
+ * Updates the value of an existing setting.
26
+ * The setting is identified by its unique name across all appliances and package settings.
27
+ *
28
+ * @param settingName - The unique name of the setting to update
29
+ * @param value - The new value for the setting
30
+ * @returns Promise that resolves when the setting value is successfully updated
31
+ */
32
+ updateSetting(settingName: string, value: string): Promise<void>;
33
+ /**
34
+ * Registers a listener that will be called when any setting value changes.
35
+ * The listener will be notified of changes to both appliance-specific and package-wide settings.
36
+ *
37
+ * @param listener - The callback function to be called on setting changes
38
+ */
39
+ listenForSettingsChanges(listener: EnyoSettingsChangeListener): void;
40
+ /**
41
+ * Retrieves all currently configured settings with their unique identifiers and current values.
42
+ * This includes settings for both specific appliances and the entire package.
43
+ *
44
+ * @returns Promise that resolves to an array of all settings with their IDs and current values
45
+ */
46
+ getSettingsConfig(): Promise<EnyoSettingConfigWithValue[]>;
47
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Interface for persistent storage operations in enyo packages.
3
+ * Provides key-value storage capabilities for package data persistence.
4
+ */
5
+ export interface EnergyAppStorage {
6
+ /** Save an object to storage with the specified key */
7
+ save: (key: string, value: object) => Promise<void>;
8
+ /** Load an object from storage by key, returns null if not found */
9
+ load: <T>(key: string) => Promise<T | null>;
10
+ /** Remove an object from storage by key */
11
+ remove: (key: string) => Promise<void>;
12
+ /** Returns a list of all keys stored in the storage */
13
+ listKeys: () => Promise<string[]>;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { EnyoVehicle } from "../types/enyo-vehicle.js";
2
+ /**
3
+ * Interface for managing vehicles in enyo packages.
4
+ * Provides read-only operations for vehicle information.
5
+ */
6
+ export interface EnergyAppVehicle {
7
+ /** Get a list of all registered vehicles */
8
+ list: () => Promise<EnyoVehicle[]>;
9
+ /** Get a specific vehicle by its ID */
10
+ getById: (id: string) => Promise<EnyoVehicle | null>;
11
+ }
@@ -0,0 +1 @@
1
+ export {};