tesla-fleet-api 0.3.0 → 0.5.0

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 (342) hide show
  1. package/README.md +284 -1
  2. package/dist/_virtual/_rolldown/runtime.cjs +32 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +12 -0
  4. package/dist/bluetooth/adapters/shared.cjs +38 -0
  5. package/dist/bluetooth/adapters/shared.mjs +36 -0
  6. package/dist/bluetooth/async.cjs +121 -0
  7. package/dist/bluetooth/async.d.cts +10 -0
  8. package/dist/bluetooth/async.d.mts +10 -0
  9. package/dist/bluetooth/async.mjs +116 -0
  10. package/dist/bluetooth/broadcast.cjs +153 -0
  11. package/dist/bluetooth/broadcast.d.cts +59 -0
  12. package/dist/bluetooth/broadcast.d.mts +59 -0
  13. package/dist/bluetooth/broadcast.mjs +151 -0
  14. package/dist/bluetooth/constants.cjs +99 -0
  15. package/dist/bluetooth/constants.d.cts +70 -0
  16. package/dist/bluetooth/constants.d.mts +70 -0
  17. package/dist/bluetooth/constants.mjs +72 -0
  18. package/dist/bluetooth/esphome.cjs +292 -0
  19. package/dist/bluetooth/esphome.d.cts +83 -0
  20. package/dist/bluetooth/esphome.d.mts +83 -0
  21. package/dist/bluetooth/esphome.mjs +291 -0
  22. package/dist/bluetooth/framing.cjs +125 -0
  23. package/dist/bluetooth/framing.d.cts +45 -0
  24. package/dist/bluetooth/framing.d.mts +45 -0
  25. package/dist/bluetooth/framing.mjs +122 -0
  26. package/dist/bluetooth/homey.cjs +155 -0
  27. package/dist/bluetooth/homey.d.cts +75 -0
  28. package/dist/bluetooth/homey.d.mts +75 -0
  29. package/dist/bluetooth/homey.mjs +150 -0
  30. package/dist/bluetooth/names.cjs +24 -0
  31. package/dist/bluetooth/names.d.cts +10 -0
  32. package/dist/bluetooth/names.d.mts +10 -0
  33. package/dist/bluetooth/names.mjs +20 -0
  34. package/dist/bluetooth/noble.cjs +178 -0
  35. package/dist/bluetooth/noble.d.cts +58 -0
  36. package/dist/bluetooth/noble.d.mts +58 -0
  37. package/dist/bluetooth/noble.mjs +177 -0
  38. package/dist/bluetooth/streamglue.cjs +157 -0
  39. package/dist/bluetooth/streamglue.d.cts +37 -0
  40. package/dist/bluetooth/streamglue.d.mts +37 -0
  41. package/dist/bluetooth/streamglue.mjs +154 -0
  42. package/dist/bluetooth/teslabluetooth.cjs +67 -0
  43. package/dist/bluetooth/teslabluetooth.d.cts +41 -0
  44. package/dist/bluetooth/teslabluetooth.d.mts +41 -0
  45. package/dist/bluetooth/teslabluetooth.mjs +66 -0
  46. package/dist/bluetooth/transport.cjs +10 -0
  47. package/dist/bluetooth/transport.d.cts +95 -0
  48. package/dist/bluetooth/transport.d.mts +95 -0
  49. package/dist/bluetooth/transport.mjs +10 -0
  50. package/dist/bluetooth/vehiclebluetooth.cjs +1272 -0
  51. package/dist/bluetooth/vehiclebluetooth.d.cts +495 -0
  52. package/dist/bluetooth/vehiclebluetooth.d.mts +495 -0
  53. package/dist/bluetooth/vehiclebluetooth.mjs +1270 -0
  54. package/dist/bluetooth/verify.cjs +93 -0
  55. package/dist/bluetooth/verify.d.cts +35 -0
  56. package/dist/bluetooth/verify.d.mts +35 -0
  57. package/dist/bluetooth/verify.mjs +91 -0
  58. package/dist/bluetooth.cjs +53 -0
  59. package/dist/bluetooth.d.cts +10 -0
  60. package/dist/bluetooth.d.mts +10 -0
  61. package/dist/bluetooth.mjs +9 -0
  62. package/dist/charging.cjs +53 -0
  63. package/dist/charging.d.cts +31 -0
  64. package/dist/charging.d.mts +30 -0
  65. package/dist/charging.mjs +53 -0
  66. package/dist/commands.cjs +1797 -0
  67. package/dist/commands.d.cts +881 -0
  68. package/dist/commands.d.mts +881 -0
  69. package/dist/commands.mjs +1791 -0
  70. package/dist/const.cjs +322 -0
  71. package/dist/const.d.cts +308 -0
  72. package/dist/const.d.mts +308 -0
  73. package/dist/const.mjs +282 -0
  74. package/dist/energy.cjs +142 -0
  75. package/dist/energy.d.cts +101 -0
  76. package/dist/energy.d.mts +100 -0
  77. package/dist/energy.mjs +142 -0
  78. package/dist/energyisland.cjs +38 -0
  79. package/dist/energyisland.mjs +37 -0
  80. package/dist/energyparsers.cjs +118 -0
  81. package/dist/energyparsers.d.cts +39 -0
  82. package/dist/energyparsers.d.mts +39 -0
  83. package/dist/energyparsers.mjs +116 -0
  84. package/dist/energyspecific.cjs +457 -0
  85. package/dist/energyspecific.d.cts +258 -0
  86. package/dist/energyspecific.d.mts +258 -0
  87. package/dist/energyspecific.mjs +451 -0
  88. package/dist/exceptions.cjs +1488 -0
  89. package/dist/exceptions.d.cts +1143 -0
  90. package/dist/exceptions.d.mts +1143 -0
  91. package/dist/exceptions.mjs +1325 -0
  92. package/dist/funnel.cjs +297 -0
  93. package/dist/funnel.d.cts +118 -0
  94. package/dist/funnel.d.mts +118 -0
  95. package/dist/funnel.mjs +292 -0
  96. package/dist/index.cjs +287 -0
  97. package/dist/index.d.cts +28 -0
  98. package/dist/index.d.mts +28 -0
  99. package/dist/index.mjs +27 -0
  100. package/dist/log.cjs +75 -0
  101. package/dist/log.d.cts +4 -0
  102. package/dist/log.d.mts +4 -0
  103. package/dist/log.mjs +71 -0
  104. package/dist/oauth.cjs +143 -0
  105. package/dist/oauth.d.cts +69 -0
  106. package/dist/oauth.d.mts +69 -0
  107. package/dist/oauth.mjs +143 -0
  108. package/dist/partner.cjs +32 -0
  109. package/dist/partner.d.cts +24 -0
  110. package/dist/partner.d.mts +23 -0
  111. package/dist/partner.mjs +32 -0
  112. package/dist/powerwall/client.cjs +818 -0
  113. package/dist/powerwall/client.d.cts +297 -0
  114. package/dist/powerwall/client.d.mts +297 -0
  115. package/dist/powerwall/client.mjs +807 -0
  116. package/dist/powerwall/components.cjs +188 -0
  117. package/dist/powerwall/components.d.cts +45 -0
  118. package/dist/powerwall/components.d.mts +45 -0
  119. package/dist/powerwall/components.mjs +182 -0
  120. package/dist/powerwall/energysite.cjs +216 -0
  121. package/dist/powerwall/energysite.d.cts +104 -0
  122. package/dist/powerwall/energysite.d.mts +104 -0
  123. package/dist/powerwall/energysite.mjs +214 -0
  124. package/dist/powerwall/exceptions.cjs +59 -0
  125. package/dist/powerwall/exceptions.d.cts +38 -0
  126. package/dist/powerwall/exceptions.d.mts +38 -0
  127. package/dist/powerwall/exceptions.mjs +51 -0
  128. package/dist/powerwall/gateway.cjs +102 -0
  129. package/dist/powerwall/gateway.d.cts +57 -0
  130. package/dist/powerwall/gateway.d.mts +57 -0
  131. package/dist/powerwall/gateway.mjs +101 -0
  132. package/dist/powerwall/merge.cjs +163 -0
  133. package/dist/powerwall/merge.d.cts +63 -0
  134. package/dist/powerwall/merge.d.mts +63 -0
  135. package/dist/powerwall/merge.mjs +159 -0
  136. package/dist/powerwall/models.d.cts +95 -0
  137. package/dist/powerwall/models.d.mts +95 -0
  138. package/dist/powerwall/queries.cjs +17 -0
  139. package/dist/powerwall/queries.mjs +10 -0
  140. package/dist/powerwall/transport.cjs +232 -0
  141. package/dist/powerwall/transport.mjs +227 -0
  142. package/dist/powerwall.cjs +47 -0
  143. package/dist/powerwall.d.cts +9 -0
  144. package/dist/powerwall.d.mts +9 -0
  145. package/dist/powerwall.mjs +8 -0
  146. package/dist/router/base.cjs +203 -0
  147. package/dist/router/base.d.cts +112 -0
  148. package/dist/router/base.d.mts +112 -0
  149. package/dist/router/base.mjs +200 -0
  150. package/dist/router/energysite.cjs +65 -0
  151. package/dist/router/energysite.d.cts +47 -0
  152. package/dist/router/energysite.d.mts +47 -0
  153. package/dist/router/energysite.mjs +60 -0
  154. package/dist/router.cjs +13 -0
  155. package/dist/router.d.cts +3 -0
  156. package/dist/router.d.mts +3 -0
  157. package/dist/router.mjs +3 -0
  158. package/dist/signing/crypto.cjs +59 -0
  159. package/dist/signing/crypto.mjs +52 -0
  160. package/dist/signing/energy.cjs +123 -0
  161. package/dist/signing/energy.d.cts +45 -0
  162. package/dist/signing/energy.d.mts +45 -0
  163. package/dist/signing/energy.mjs +120 -0
  164. package/dist/signing/jws.cjs +229 -0
  165. package/dist/signing/jws.d.cts +45 -0
  166. package/dist/signing/jws.d.mts +45 -0
  167. package/dist/signing/jws.mjs +211 -0
  168. package/dist/signing/keys.cjs +191 -0
  169. package/dist/signing/keys.d.cts +21 -0
  170. package/dist/signing/keys.d.mts +21 -0
  171. package/dist/signing/keys.mjs +182 -0
  172. package/dist/signing/session.cjs +186 -0
  173. package/dist/signing/session.d.cts +106 -0
  174. package/dist/signing/session.d.mts +106 -0
  175. package/dist/signing/session.mjs +184 -0
  176. package/dist/tariff.cjs +319 -0
  177. package/dist/tariff.d.cts +40 -0
  178. package/dist/tariff.d.mts +40 -0
  179. package/dist/tariff.mjs +317 -0
  180. package/dist/teslafleetapi.cjs +326 -0
  181. package/dist/teslafleetapi.d.cts +160 -0
  182. package/dist/teslafleetapi.d.mts +160 -0
  183. package/dist/teslafleetapi.mjs +326 -0
  184. package/dist/teslemetry.cjs +183 -0
  185. package/dist/teslemetry.d.cts +113 -0
  186. package/dist/teslemetry.d.mts +113 -0
  187. package/dist/teslemetry.mjs +181 -0
  188. package/dist/teslemetryenergy.cjs +287 -0
  189. package/dist/teslemetryenergy.d.cts +154 -0
  190. package/dist/teslemetryenergy.d.mts +154 -0
  191. package/dist/teslemetryenergy.mjs +282 -0
  192. package/dist/teslemetryvehicle.cjs +407 -0
  193. package/dist/teslemetryvehicle.d.cts +238 -0
  194. package/dist/teslemetryvehicle.d.mts +238 -0
  195. package/dist/teslemetryvehicle.mjs +405 -0
  196. package/dist/tessie.cjs +71 -0
  197. package/dist/tessie.d.cts +69 -0
  198. package/dist/tessie.d.mts +69 -0
  199. package/dist/tessie.mjs +71 -0
  200. package/dist/tessievehicle.cjs +514 -0
  201. package/dist/tessievehicle.d.cts +333 -0
  202. package/dist/tessievehicle.d.mts +333 -0
  203. package/dist/tessievehicle.mjs +513 -0
  204. package/dist/types/commands.d.cts +28 -0
  205. package/dist/types/commands.d.mts +28 -0
  206. package/dist/types/live_status.d.cts +30 -0
  207. package/dist/types/live_status.d.mts +30 -0
  208. package/dist/types/products.d.cts +58 -0
  209. package/dist/types/products.d.mts +58 -0
  210. package/dist/types/responses.d.cts +13 -0
  211. package/dist/types/responses.d.mts +13 -0
  212. package/dist/types/site_info.d.cts +154 -0
  213. package/dist/types/site_info.d.mts +154 -0
  214. package/dist/types/vehicle.d.cts +33 -0
  215. package/dist/types/vehicle.d.mts +33 -0
  216. package/dist/types/vehicle_data.d.cts +278 -0
  217. package/dist/types/vehicle_data.d.mts +278 -0
  218. package/dist/types.cjs +0 -0
  219. package/dist/types.d.cts +9 -0
  220. package/dist/types.d.mts +9 -0
  221. package/dist/types.mjs +1 -0
  222. package/dist/user.cjs +28 -0
  223. package/dist/user.d.cts +17 -0
  224. package/dist/user.d.mts +16 -0
  225. package/dist/user.mjs +28 -0
  226. package/dist/util.cjs +41 -0
  227. package/dist/util.d.cts +18 -0
  228. package/dist/util.d.mts +18 -0
  229. package/dist/util.mjs +40 -0
  230. package/dist/vehicle.cjs +847 -0
  231. package/dist/vehicle.d.cts +566 -0
  232. package/dist/vehicle.d.mts +565 -0
  233. package/dist/vehicle.mjs +847 -0
  234. package/dist/vehiclesigned.cjs +35 -0
  235. package/dist/vehiclesigned.d.cts +23 -0
  236. package/dist/vehiclesigned.d.mts +22 -0
  237. package/dist/vehiclesigned.mjs +35 -0
  238. package/dist/vehiclespecific.cjs +715 -0
  239. package/dist/vehiclespecific.d.cts +497 -0
  240. package/dist/vehiclespecific.d.mts +496 -0
  241. package/dist/vehiclespecific.mjs +715 -0
  242. package/package.json +178 -38
  243. package/dist/charging.d.ts +0 -30
  244. package/dist/charging.js +0 -51
  245. package/dist/charging.js.map +0 -1
  246. package/dist/commands.d.ts +0 -352
  247. package/dist/commands.js +0 -875
  248. package/dist/commands.js.map +0 -1
  249. package/dist/energy.d.ts +0 -94
  250. package/dist/energy.js +0 -125
  251. package/dist/energy.js.map +0 -1
  252. package/dist/energyspecific.d.ts +0 -77
  253. package/dist/energyspecific.js +0 -97
  254. package/dist/energyspecific.js.map +0 -1
  255. package/dist/helpers.d.ts +0 -2
  256. package/dist/helpers.js +0 -10
  257. package/dist/helpers.js.map +0 -1
  258. package/dist/index.d.ts +0 -15
  259. package/dist/index.js +0 -15
  260. package/dist/index.js.map +0 -1
  261. package/dist/partner.d.ts +0 -23
  262. package/dist/partner.js +0 -31
  263. package/dist/partner.js.map +0 -1
  264. package/dist/signing/crypto.d.ts +0 -10
  265. package/dist/signing/crypto.js +0 -26
  266. package/dist/signing/crypto.js.map +0 -1
  267. package/dist/signing/errors.d.ts +0 -29
  268. package/dist/signing/errors.js +0 -40
  269. package/dist/signing/errors.js.map +0 -1
  270. package/dist/signing/session.d.ts +0 -69
  271. package/dist/signing/session.js +0 -102
  272. package/dist/signing/session.js.map +0 -1
  273. package/dist/tariff.d.ts +0 -29
  274. package/dist/tariff.js +0 -302
  275. package/dist/tariff.js.map +0 -1
  276. package/dist/teslafleetapi.d.ts +0 -58
  277. package/dist/teslafleetapi.js +0 -120
  278. package/dist/teslafleetapi.js.map +0 -1
  279. package/dist/teslemetry.d.ts +0 -29
  280. package/dist/teslemetry.js +0 -39
  281. package/dist/teslemetry.js.map +0 -1
  282. package/dist/tessie.d.ts +0 -23
  283. package/dist/tessie.js +0 -28
  284. package/dist/tessie.js.map +0 -1
  285. package/dist/types/commands.d.ts +0 -44
  286. package/dist/types/commands.js +0 -11
  287. package/dist/types/commands.js.map +0 -1
  288. package/dist/types/live_status.d.ts +0 -26
  289. package/dist/types/live_status.js +0 -2
  290. package/dist/types/live_status.js.map +0 -1
  291. package/dist/types/products.d.ts +0 -54
  292. package/dist/types/products.js +0 -2
  293. package/dist/types/products.js.map +0 -1
  294. package/dist/types/responses.d.ts +0 -5
  295. package/dist/types/responses.js +0 -2
  296. package/dist/types/responses.js.map +0 -1
  297. package/dist/types/site_info.d.ts +0 -150
  298. package/dist/types/site_info.js +0 -2
  299. package/dist/types/site_info.js.map +0 -1
  300. package/dist/types/vehicle.d.ts +0 -23
  301. package/dist/types/vehicle.js +0 -10
  302. package/dist/types/vehicle.js.map +0 -1
  303. package/dist/types/vehicle_data.d.ts +0 -274
  304. package/dist/types/vehicle_data.js +0 -2
  305. package/dist/types/vehicle_data.js.map +0 -1
  306. package/dist/user.d.ts +0 -16
  307. package/dist/user.js +0 -26
  308. package/dist/user.js.map +0 -1
  309. package/dist/vehicle.d.ts +0 -548
  310. package/dist/vehicle.js +0 -774
  311. package/dist/vehicle.js.map +0 -1
  312. package/dist/vehiclesigned.d.ts +0 -13
  313. package/dist/vehiclesigned.js +0 -19
  314. package/dist/vehiclesigned.js.map +0 -1
  315. package/dist/vehiclespecific.d.ts +0 -432
  316. package/dist/vehiclespecific.js +0 -601
  317. package/dist/vehiclespecific.js.map +0 -1
  318. package/src/charging.ts +0 -66
  319. package/src/commands.ts +0 -1134
  320. package/src/energy.ts +0 -217
  321. package/src/energyspecific.ts +0 -116
  322. package/src/helpers.ts +0 -11
  323. package/src/index.ts +0 -21
  324. package/src/partner.ts +0 -37
  325. package/src/signing/crypto.ts +0 -29
  326. package/src/signing/errors.ts +0 -50
  327. package/src/signing/session.ts +0 -132
  328. package/src/tariff.ts +0 -375
  329. package/src/teslafleetapi.ts +0 -182
  330. package/src/teslemetry.ts +0 -54
  331. package/src/tessie.ts +0 -42
  332. package/src/types/commands.ts +0 -62
  333. package/src/types/live_status.ts +0 -27
  334. package/src/types/products.ts +0 -61
  335. package/src/types/responses.ts +0 -1
  336. package/src/types/site_info.ts +0 -159
  337. package/src/types/vehicle.ts +0 -33
  338. package/src/types/vehicle_data.ts +0 -286
  339. package/src/user.ts +0 -35
  340. package/src/vehicle.ts +0 -886
  341. package/src/vehiclesigned.ts +0 -20
  342. package/src/vehiclespecific.ts +0 -818
@@ -0,0 +1,104 @@
1
+ import { EnergyIslandMode } from "../const.cjs";
2
+ import { AuthorizedClients } from "../energyparsers.cjs";
3
+ import { LiveStatusResponse } from "../types/live_status.cjs";
4
+ import { PowerwallClient } from "./client.cjs";
5
+ import { AuthorizedClientsPayload, BackupEventsPayload } from "./models.cjs";
6
+ /** The cloud energy command envelope. */
7
+ export type CommandResult = {
8
+ response: {
9
+ code: number;
10
+ message: string;
11
+ result: boolean;
12
+ };
13
+ };
14
+ /** The subset of `config.json` with a faithful cloud mapping. A key is omitted when its source is absent. */
15
+ export type LocalConfig = {
16
+ backup_reserve_percent?: number;
17
+ default_real_mode?: string;
18
+ };
19
+ /** Grid-connected, the `mode` for `set_island_mode` that reconnects. */
20
+ export declare const ISLAND_MODE_ON_GRID: 1;
21
+ /** Islanded, the `mode` for `set_island_mode` that goes off grid. */
22
+ export declare const ISLAND_MODE_OFF_GRID: 6;
23
+ /**
24
+ * The cloud energy site's surface over a local `PowerwallClient`: the same method
25
+ * names, arguments and reply shapes, so a router can prefer the LAN and fall back
26
+ * to the cloud. It imports nothing from the router.
27
+ *
28
+ * What has no local mapping is absent rather than stubbed, so a router routes it
29
+ * to the cloud: `site_info`, `storm_mode`, the histories and the rest of Python's
30
+ * `NotImplementedError` group. `add_authorized_client` is one of those, because
31
+ * registration goes through the cloud.
32
+ */
33
+ export declare class PowerwallEnergySite {
34
+ #private;
35
+ /** @param client An existing client. This never opens its own transport. */
36
+ constructor(client: PowerwallClient);
37
+ /** The wrapped client, for what has no cloud counterpart. */
38
+ get powerwall(): PowerwallClient;
39
+ /**
40
+ * Set the operation mode.
41
+ * @param default_real_mode `self_consumption`, `autonomous` or `backup`.
42
+ */
43
+ operation(default_real_mode: string): Promise<CommandResult>;
44
+ /**
45
+ * Set the backup reserve.
46
+ * @param backup_reserve_percent On the app's 0-100 scale, as the cloud takes it.
47
+ */
48
+ backup(backup_reserve_percent: number): Promise<CommandResult>;
49
+ /** Set the grid-charging flag and export rule. Both in one call means one `config.json` write. */
50
+ grid_import_export(disallow_charge_from_grid_with_solar_installed?: boolean | null, customer_preferred_export_rule?: string | null): Promise<CommandResult>;
51
+ /**
52
+ * Open or close the grid contactor. See `PowerwallClient.set_island_mode`:
53
+ * read `islanding.contactorClosed` afterwards.
54
+ * @param mode 6 islands and 1 reconnects. Anything else raises `TypeError`.
55
+ * @param force Defaults to true off grid and false otherwise, like the cloud.
56
+ */
57
+ set_island_mode(mode: EnergyIslandMode | number, force?: boolean | null): Promise<CommandResult>;
58
+ /** Disconnect from the grid. */
59
+ go_off_grid(): Promise<CommandResult>;
60
+ /** Reconnect to the grid. */
61
+ reconnect_grid(): Promise<CommandResult>;
62
+ /**
63
+ * Schedule a manual backup event. `start_time` and `priority` exist for
64
+ * signature parity and are not honoured: the event always starts now at
65
+ * maximum priority.
66
+ * @param duration_seconds Defaults to 7200.
67
+ */
68
+ schedule_backup_event(_start_time?: string | null, duration_seconds?: number | null, _priority?: number | string | null): Promise<CommandResult>;
69
+ /** Cancel the active manual backup event. */
70
+ cancel_backup_event(): Promise<CommandResult>;
71
+ /**
72
+ * Request a timed battery power setpoint.
73
+ * @param power_watts Positive discharges, negative charges.
74
+ * @param duration_seconds Whole seconds from 1 to 86400.
75
+ */
76
+ dispatch_battery_power(power_watts: number, duration_seconds: number): Promise<CommandResult>;
77
+ /** Release a `dispatch_battery_power` setpoint. */
78
+ resume_battery_operation(): Promise<CommandResult>;
79
+ /** The active manual backup and scheduled events, in the local shape: the cloud's gRPC reply cannot be reproduced. */
80
+ get_backup_events(): Promise<{
81
+ response: BackupEventsPayload;
82
+ }>;
83
+ /**
84
+ * A cloud-shaped `live_status`, from three sequential reads. Keys with no local
85
+ * source are `null`, never guessed. A merge with the cloud fills them in.
86
+ */
87
+ live_status(): Promise<{
88
+ response: LiveStatusResponse;
89
+ }>;
90
+ /** The reserve (on the app's scale) and mode from `config.json`. A bare object, unlike the cloud's reads. */
91
+ local_config(): Promise<LocalConfig>;
92
+ /** The paired keys in the gateway's raw form. Prefer `find_authorized_clients`. */
93
+ list_authorized_clients(): Promise<{
94
+ response: AuthorizedClientsPayload;
95
+ }>;
96
+ /** The paired keys, in the same typed form as `TeslemetryEnergySite.find_authorized_clients`. */
97
+ find_authorized_clients(): Promise<AuthorizedClients>;
98
+ /**
99
+ * Revoke a paired key. Any paired key can remove any other, and removing the
100
+ * signing key locks this client out.
101
+ * @param public_key Raw DER bytes, or base64 as `list_authorized_clients` reports it.
102
+ */
103
+ remove_authorized_client(public_key: Uint8Array | string): Promise<CommandResult>;
104
+ }
@@ -0,0 +1,104 @@
1
+ import { EnergyIslandMode } from "../const.mjs";
2
+ import { AuthorizedClients } from "../energyparsers.mjs";
3
+ import { LiveStatusResponse } from "../types/live_status.mjs";
4
+ import { PowerwallClient } from "./client.mjs";
5
+ import { AuthorizedClientsPayload, BackupEventsPayload } from "./models.mjs";
6
+ /** The cloud energy command envelope. */
7
+ export type CommandResult = {
8
+ response: {
9
+ code: number;
10
+ message: string;
11
+ result: boolean;
12
+ };
13
+ };
14
+ /** The subset of `config.json` with a faithful cloud mapping. A key is omitted when its source is absent. */
15
+ export type LocalConfig = {
16
+ backup_reserve_percent?: number;
17
+ default_real_mode?: string;
18
+ };
19
+ /** Grid-connected, the `mode` for `set_island_mode` that reconnects. */
20
+ export declare const ISLAND_MODE_ON_GRID: 1;
21
+ /** Islanded, the `mode` for `set_island_mode` that goes off grid. */
22
+ export declare const ISLAND_MODE_OFF_GRID: 6;
23
+ /**
24
+ * The cloud energy site's surface over a local `PowerwallClient`: the same method
25
+ * names, arguments and reply shapes, so a router can prefer the LAN and fall back
26
+ * to the cloud. It imports nothing from the router.
27
+ *
28
+ * What has no local mapping is absent rather than stubbed, so a router routes it
29
+ * to the cloud: `site_info`, `storm_mode`, the histories and the rest of Python's
30
+ * `NotImplementedError` group. `add_authorized_client` is one of those, because
31
+ * registration goes through the cloud.
32
+ */
33
+ export declare class PowerwallEnergySite {
34
+ #private;
35
+ /** @param client An existing client. This never opens its own transport. */
36
+ constructor(client: PowerwallClient);
37
+ /** The wrapped client, for what has no cloud counterpart. */
38
+ get powerwall(): PowerwallClient;
39
+ /**
40
+ * Set the operation mode.
41
+ * @param default_real_mode `self_consumption`, `autonomous` or `backup`.
42
+ */
43
+ operation(default_real_mode: string): Promise<CommandResult>;
44
+ /**
45
+ * Set the backup reserve.
46
+ * @param backup_reserve_percent On the app's 0-100 scale, as the cloud takes it.
47
+ */
48
+ backup(backup_reserve_percent: number): Promise<CommandResult>;
49
+ /** Set the grid-charging flag and export rule. Both in one call means one `config.json` write. */
50
+ grid_import_export(disallow_charge_from_grid_with_solar_installed?: boolean | null, customer_preferred_export_rule?: string | null): Promise<CommandResult>;
51
+ /**
52
+ * Open or close the grid contactor. See `PowerwallClient.set_island_mode`:
53
+ * read `islanding.contactorClosed` afterwards.
54
+ * @param mode 6 islands and 1 reconnects. Anything else raises `TypeError`.
55
+ * @param force Defaults to true off grid and false otherwise, like the cloud.
56
+ */
57
+ set_island_mode(mode: EnergyIslandMode | number, force?: boolean | null): Promise<CommandResult>;
58
+ /** Disconnect from the grid. */
59
+ go_off_grid(): Promise<CommandResult>;
60
+ /** Reconnect to the grid. */
61
+ reconnect_grid(): Promise<CommandResult>;
62
+ /**
63
+ * Schedule a manual backup event. `start_time` and `priority` exist for
64
+ * signature parity and are not honoured: the event always starts now at
65
+ * maximum priority.
66
+ * @param duration_seconds Defaults to 7200.
67
+ */
68
+ schedule_backup_event(_start_time?: string | null, duration_seconds?: number | null, _priority?: number | string | null): Promise<CommandResult>;
69
+ /** Cancel the active manual backup event. */
70
+ cancel_backup_event(): Promise<CommandResult>;
71
+ /**
72
+ * Request a timed battery power setpoint.
73
+ * @param power_watts Positive discharges, negative charges.
74
+ * @param duration_seconds Whole seconds from 1 to 86400.
75
+ */
76
+ dispatch_battery_power(power_watts: number, duration_seconds: number): Promise<CommandResult>;
77
+ /** Release a `dispatch_battery_power` setpoint. */
78
+ resume_battery_operation(): Promise<CommandResult>;
79
+ /** The active manual backup and scheduled events, in the local shape: the cloud's gRPC reply cannot be reproduced. */
80
+ get_backup_events(): Promise<{
81
+ response: BackupEventsPayload;
82
+ }>;
83
+ /**
84
+ * A cloud-shaped `live_status`, from three sequential reads. Keys with no local
85
+ * source are `null`, never guessed. A merge with the cloud fills them in.
86
+ */
87
+ live_status(): Promise<{
88
+ response: LiveStatusResponse;
89
+ }>;
90
+ /** The reserve (on the app's scale) and mode from `config.json`. A bare object, unlike the cloud's reads. */
91
+ local_config(): Promise<LocalConfig>;
92
+ /** The paired keys in the gateway's raw form. Prefer `find_authorized_clients`. */
93
+ list_authorized_clients(): Promise<{
94
+ response: AuthorizedClientsPayload;
95
+ }>;
96
+ /** The paired keys, in the same typed form as `TeslemetryEnergySite.find_authorized_clients`. */
97
+ find_authorized_clients(): Promise<AuthorizedClients>;
98
+ /**
99
+ * Revoke a paired key. Any paired key can remove any other, and removing the
100
+ * signing key locks this client out.
101
+ * @param public_key Raw DER bytes, or base64 as `list_authorized_clients` reports it.
102
+ */
103
+ remove_authorized_client(public_key: Uint8Array | string): Promise<CommandResult>;
104
+ }
@@ -0,0 +1,214 @@
1
+ import { EnergyIslandMode } from "../const.mjs";
2
+ import { validate_island_mode } from "../energyisland.mjs";
3
+ import { parse_authorized_clients } from "../energyparsers.mjs";
4
+ import { battery_level, raw_to_scaled_reserve } from "./client.mjs";
5
+ // src/powerwall/energysite.ts
6
+ /** Best-effort cloud `grid_status` and `island_status` for each gateway grid string. */
7
+ const GRID_STATUS = {
8
+ SystemGridConnected: {
9
+ grid_status: "Active",
10
+ island_status: "on_grid"
11
+ },
12
+ SystemIslandedActive: {
13
+ grid_status: "Inactive",
14
+ island_status: "off_grid"
15
+ },
16
+ SystemIslandedReady: {
17
+ grid_status: "Inactive",
18
+ island_status: "off_grid"
19
+ },
20
+ SystemTransitionToGrid: {
21
+ grid_status: "Active",
22
+ island_status: "on_grid"
23
+ },
24
+ SystemTransitionToIsland: {
25
+ grid_status: "Inactive",
26
+ island_status: "off_grid"
27
+ },
28
+ SystemMicroGridFaulted: {
29
+ grid_status: "Inactive",
30
+ island_status: "off_grid"
31
+ },
32
+ SystemWaitForUser: {
33
+ grid_status: "Inactive",
34
+ island_status: "island_status_unknown"
35
+ }
36
+ };
37
+ const GRID_STATUS_UNKNOWN = {
38
+ grid_status: "Unknown",
39
+ island_status: "island_status_unknown"
40
+ };
41
+ /** Grid-connected, the `mode` for `set_island_mode` that reconnects. */
42
+ const ISLAND_MODE_ON_GRID = EnergyIslandMode.ON_GRID;
43
+ /** Islanded, the `mode` for `set_island_mode` that goes off grid. */
44
+ const ISLAND_MODE_OFF_GRID = EnergyIslandMode.OFF_GRID;
45
+ function ok() {
46
+ return { response: {
47
+ code: 201,
48
+ message: "",
49
+ result: true
50
+ } };
51
+ }
52
+ function numberOrNull(value) {
53
+ return typeof value === "number" ? value : null;
54
+ }
55
+ /**
56
+ * The cloud energy site's surface over a local `PowerwallClient`: the same method
57
+ * names, arguments and reply shapes, so a router can prefer the LAN and fall back
58
+ * to the cloud. It imports nothing from the router.
59
+ *
60
+ * What has no local mapping is absent rather than stubbed, so a router routes it
61
+ * to the cloud: `site_info`, `storm_mode`, the histories and the rest of Python's
62
+ * `NotImplementedError` group. `add_authorized_client` is one of those, because
63
+ * registration goes through the cloud.
64
+ */
65
+ var PowerwallEnergySite = class {
66
+ #client;
67
+ /** @param client An existing client. This never opens its own transport. */
68
+ constructor(client) {
69
+ this.#client = client;
70
+ }
71
+ /** The wrapped client, for what has no cloud counterpart. */
72
+ get powerwall() {
73
+ return this.#client;
74
+ }
75
+ /**
76
+ * Set the operation mode.
77
+ * @param default_real_mode `self_consumption`, `autonomous` or `backup`.
78
+ */
79
+ async operation(default_real_mode) {
80
+ await this.#client.set_operation_mode(default_real_mode);
81
+ return ok();
82
+ }
83
+ /**
84
+ * Set the backup reserve.
85
+ * @param backup_reserve_percent On the app's 0-100 scale, as the cloud takes it.
86
+ */
87
+ async backup(backup_reserve_percent) {
88
+ await this.#client.set_backup_reserve(backup_reserve_percent);
89
+ return ok();
90
+ }
91
+ /** Set the grid-charging flag and export rule. Both in one call means one `config.json` write. */
92
+ async grid_import_export(disallow_charge_from_grid_with_solar_installed = null, customer_preferred_export_rule = null) {
93
+ await this.#client.set_grid_import_export({
94
+ customer_preferred_export_rule,
95
+ disallow_charge_from_grid_with_solar_installed
96
+ });
97
+ return ok();
98
+ }
99
+ /**
100
+ * Open or close the grid contactor. See `PowerwallClient.set_island_mode`:
101
+ * read `islanding.contactorClosed` afterwards.
102
+ * @param mode 6 islands and 1 reconnects. Anything else raises `TypeError`.
103
+ * @param force Defaults to true off grid and false otherwise, like the cloud.
104
+ */
105
+ async set_island_mode(mode, force) {
106
+ validate_island_mode(mode, force);
107
+ const off_grid = mode === EnergyIslandMode.OFF_GRID;
108
+ await this.#client.set_island_mode({
109
+ off_grid,
110
+ force: force ?? off_grid,
111
+ mode_override: mode
112
+ });
113
+ return ok();
114
+ }
115
+ /** Disconnect from the grid. */
116
+ async go_off_grid() {
117
+ await this.#client.go_off_grid();
118
+ return ok();
119
+ }
120
+ /** Reconnect to the grid. */
121
+ async reconnect_grid() {
122
+ await this.#client.reconnect_grid();
123
+ return ok();
124
+ }
125
+ /**
126
+ * Schedule a manual backup event. `start_time` and `priority` exist for
127
+ * signature parity and are not honoured: the event always starts now at
128
+ * maximum priority.
129
+ * @param duration_seconds Defaults to 7200.
130
+ */
131
+ async schedule_backup_event(_start_time, duration_seconds, _priority) {
132
+ await this.#client.schedule_max_backup(duration_seconds ?? void 0);
133
+ return ok();
134
+ }
135
+ /** Cancel the active manual backup event. */
136
+ async cancel_backup_event() {
137
+ await this.#client.cancel_max_backup();
138
+ return ok();
139
+ }
140
+ /**
141
+ * Request a timed battery power setpoint.
142
+ * @param power_watts Positive discharges, negative charges.
143
+ * @param duration_seconds Whole seconds from 1 to 86400.
144
+ */
145
+ async dispatch_battery_power(power_watts, duration_seconds) {
146
+ await this.#client.dispatch_battery_power(power_watts, duration_seconds);
147
+ return ok();
148
+ }
149
+ /** Release a `dispatch_battery_power` setpoint. */
150
+ async resume_battery_operation() {
151
+ await this.#client.resume_battery_operation();
152
+ return ok();
153
+ }
154
+ /** The active manual backup and scheduled events, in the local shape: the cloud's gRPC reply cannot be reproduced. */
155
+ async get_backup_events() {
156
+ return { response: await this.#client.get_backup_events() };
157
+ }
158
+ /**
159
+ * A cloud-shaped `live_status`, from three sequential reads. Keys with no local
160
+ * source are `null`, never guessed. A merge with the cloud fills them in.
161
+ */
162
+ async live_status() {
163
+ const meters = await this.#client.get_meters_aggregates();
164
+ const status = await this.#client.get_status();
165
+ const gridStatus = await this.#client.get_grid_status();
166
+ const power = (location) => numberOrNull(meters[location]?.instant_power);
167
+ const systemStatus = status.control?.systemStatus;
168
+ return { response: {
169
+ solar_power: power("solar"),
170
+ energy_left: numberOrNull(systemStatus?.nominalEnergyRemainingWh),
171
+ total_pack_energy: numberOrNull(systemStatus?.nominalFullPackEnergyWh),
172
+ percentage_charged: battery_level(status),
173
+ backup_capable: null,
174
+ battery_power: power("battery"),
175
+ load_power: power("load"),
176
+ grid_power: power("site"),
177
+ grid_services_power: null,
178
+ generator_power: power("generator"),
179
+ ...Object.hasOwn(GRID_STATUS, gridStatus) ? GRID_STATUS[gridStatus] : GRID_STATUS_UNKNOWN,
180
+ grid_services_active: null,
181
+ storm_mode_active: null,
182
+ timestamp: null,
183
+ wall_connectors: null
184
+ } };
185
+ }
186
+ /** The reserve (on the app's scale) and mode from `config.json`. A bare object, unlike the cloud's reads. */
187
+ async local_config() {
188
+ const config = await this.#client.get_config();
189
+ const result = {};
190
+ const reserve = config.site_info?.backup_reserve_percent;
191
+ if (typeof reserve === "number") result.backup_reserve_percent = raw_to_scaled_reserve(reserve);
192
+ if (config.default_real_mode !== void 0) result.default_real_mode = config.default_real_mode;
193
+ return result;
194
+ }
195
+ /** The paired keys in the gateway's raw form. Prefer `find_authorized_clients`. */
196
+ async list_authorized_clients() {
197
+ return { response: await this.#client.list_authorized_clients() };
198
+ }
199
+ /** The paired keys, in the same typed form as `TeslemetryEnergySite.find_authorized_clients`. */
200
+ async find_authorized_clients() {
201
+ const { response } = await this.list_authorized_clients();
202
+ return parse_authorized_clients(response);
203
+ }
204
+ /**
205
+ * Revoke a paired key. Any paired key can remove any other, and removing the
206
+ * signing key locks this client out.
207
+ * @param public_key Raw DER bytes, or base64 as `list_authorized_clients` reports it.
208
+ */
209
+ async remove_authorized_client(public_key) {
210
+ await this.#client.remove_authorized_client(public_key);
211
+ return ok();
212
+ }
213
+ };
214
+ export { ISLAND_MODE_OFF_GRID, ISLAND_MODE_ON_GRID, PowerwallEnergySite };
@@ -0,0 +1,59 @@
1
+ // src/powerwall/exceptions.ts
2
+ /** Base class of every local Powerwall error. */
3
+ var PowerwallError = class extends Error {
4
+ constructor(message, options) {
5
+ super(message, options);
6
+ this.name = new.target.name;
7
+ }
8
+ };
9
+ /** The gateway could not be reached, or the request timed out. */
10
+ var PowerwallConnectionError = class extends PowerwallError {
11
+ failover_safe = true;
12
+ };
13
+ /** The gateway refused the password, or the RSA key is unusable, unregistered or not verified. */
14
+ var PowerwallAuthenticationError = class extends PowerwallError {
15
+ failover_safe = true;
16
+ };
17
+ /**
18
+ * The gateway password was accepted but the RSA key was not. Lets a repair flow
19
+ * tell a rejected key from a wrong password. Python has no counterpart.
20
+ */
21
+ var PowerwallKeyRejectedError = class extends PowerwallAuthenticationError {};
22
+ /** The gateway answered 429 or 503. Back off before retrying. */
23
+ var PowerwallRateLimitError = class extends PowerwallError {
24
+ failover_safe = true;
25
+ };
26
+ /** The gateway answered with something unexpected, such as a bad protobuf or JSON body. */
27
+ var PowerwallProtocolError = class extends PowerwallError {};
28
+ /** A signed request came back with a non-zero `message_fault`. */
29
+ var PowerwallFaultError = class extends PowerwallError {
30
+ /** The fault's enum name. */
31
+ fault;
32
+ constructor(fault, message, options) {
33
+ super(message ?? `Powerwall returned message fault: ${fault}`, options);
34
+ this.fault = fault;
35
+ }
36
+ };
37
+ /** The gateway answered a command with `common.error_response`, or refused it with a result code. */
38
+ var PowerwallCommandError = class extends PowerwallProtocolError {
39
+ command;
40
+ code;
41
+ status_message;
42
+ constructor(command, code, status_message) {
43
+ super(`Powerwall rejected ${command}: ${status_message || "no message"} (status code ${code})`);
44
+ this.command = command;
45
+ this.code = code;
46
+ this.status_message = status_message;
47
+ }
48
+ };
49
+ /** The gateway firmware does not implement the command: status code 12, `UNIMPLEMENTED`. */
50
+ var PowerwallNotSupportedError = class extends PowerwallCommandError {};
51
+ exports.PowerwallAuthenticationError = PowerwallAuthenticationError;
52
+ exports.PowerwallCommandError = PowerwallCommandError;
53
+ exports.PowerwallConnectionError = PowerwallConnectionError;
54
+ exports.PowerwallError = PowerwallError;
55
+ exports.PowerwallFaultError = PowerwallFaultError;
56
+ exports.PowerwallKeyRejectedError = PowerwallKeyRejectedError;
57
+ exports.PowerwallNotSupportedError = PowerwallNotSupportedError;
58
+ exports.PowerwallProtocolError = PowerwallProtocolError;
59
+ exports.PowerwallRateLimitError = PowerwallRateLimitError;
@@ -0,0 +1,38 @@
1
+ /** Base class of every local Powerwall error. */
2
+ export declare class PowerwallError extends Error {
3
+ constructor(message?: string, options?: ErrorOptions);
4
+ }
5
+ /** The gateway could not be reached, or the request timed out. */
6
+ export declare class PowerwallConnectionError extends PowerwallError {
7
+ readonly failover_safe = true;
8
+ }
9
+ /** The gateway refused the password, or the RSA key is unusable, unregistered or not verified. */
10
+ export declare class PowerwallAuthenticationError extends PowerwallError {
11
+ readonly failover_safe = true;
12
+ }
13
+ /**
14
+ * The gateway password was accepted but the RSA key was not. Lets a repair flow
15
+ * tell a rejected key from a wrong password. Python has no counterpart.
16
+ */
17
+ export declare class PowerwallKeyRejectedError extends PowerwallAuthenticationError {}
18
+ /** The gateway answered 429 or 503. Back off before retrying. */
19
+ export declare class PowerwallRateLimitError extends PowerwallError {
20
+ readonly failover_safe = true;
21
+ }
22
+ /** The gateway answered with something unexpected, such as a bad protobuf or JSON body. */
23
+ export declare class PowerwallProtocolError extends PowerwallError {}
24
+ /** A signed request came back with a non-zero `message_fault`. */
25
+ export declare class PowerwallFaultError extends PowerwallError {
26
+ /** The fault's enum name. */
27
+ readonly fault: string;
28
+ constructor(fault: string, message?: string, options?: ErrorOptions);
29
+ }
30
+ /** The gateway answered a command with `common.error_response`, or refused it with a result code. */
31
+ export declare class PowerwallCommandError extends PowerwallProtocolError {
32
+ readonly command: string;
33
+ readonly code: number;
34
+ readonly status_message: string;
35
+ constructor(command: string, code: number, status_message: string);
36
+ }
37
+ /** The gateway firmware does not implement the command: status code 12, `UNIMPLEMENTED`. */
38
+ export declare class PowerwallNotSupportedError extends PowerwallCommandError {}
@@ -0,0 +1,38 @@
1
+ /** Base class of every local Powerwall error. */
2
+ export declare class PowerwallError extends Error {
3
+ constructor(message?: string, options?: ErrorOptions);
4
+ }
5
+ /** The gateway could not be reached, or the request timed out. */
6
+ export declare class PowerwallConnectionError extends PowerwallError {
7
+ readonly failover_safe = true;
8
+ }
9
+ /** The gateway refused the password, or the RSA key is unusable, unregistered or not verified. */
10
+ export declare class PowerwallAuthenticationError extends PowerwallError {
11
+ readonly failover_safe = true;
12
+ }
13
+ /**
14
+ * The gateway password was accepted but the RSA key was not. Lets a repair flow
15
+ * tell a rejected key from a wrong password. Python has no counterpart.
16
+ */
17
+ export declare class PowerwallKeyRejectedError extends PowerwallAuthenticationError {}
18
+ /** The gateway answered 429 or 503. Back off before retrying. */
19
+ export declare class PowerwallRateLimitError extends PowerwallError {
20
+ readonly failover_safe = true;
21
+ }
22
+ /** The gateway answered with something unexpected, such as a bad protobuf or JSON body. */
23
+ export declare class PowerwallProtocolError extends PowerwallError {}
24
+ /** A signed request came back with a non-zero `message_fault`. */
25
+ export declare class PowerwallFaultError extends PowerwallError {
26
+ /** The fault's enum name. */
27
+ readonly fault: string;
28
+ constructor(fault: string, message?: string, options?: ErrorOptions);
29
+ }
30
+ /** The gateway answered a command with `common.error_response`, or refused it with a result code. */
31
+ export declare class PowerwallCommandError extends PowerwallProtocolError {
32
+ readonly command: string;
33
+ readonly code: number;
34
+ readonly status_message: string;
35
+ constructor(command: string, code: number, status_message: string);
36
+ }
37
+ /** The gateway firmware does not implement the command: status code 12, `UNIMPLEMENTED`. */
38
+ export declare class PowerwallNotSupportedError extends PowerwallCommandError {}
@@ -0,0 +1,51 @@
1
+ // src/powerwall/exceptions.ts
2
+ /** Base class of every local Powerwall error. */
3
+ var PowerwallError = class extends Error {
4
+ constructor(message, options) {
5
+ super(message, options);
6
+ this.name = new.target.name;
7
+ }
8
+ };
9
+ /** The gateway could not be reached, or the request timed out. */
10
+ var PowerwallConnectionError = class extends PowerwallError {
11
+ failover_safe = true;
12
+ };
13
+ /** The gateway refused the password, or the RSA key is unusable, unregistered or not verified. */
14
+ var PowerwallAuthenticationError = class extends PowerwallError {
15
+ failover_safe = true;
16
+ };
17
+ /**
18
+ * The gateway password was accepted but the RSA key was not. Lets a repair flow
19
+ * tell a rejected key from a wrong password. Python has no counterpart.
20
+ */
21
+ var PowerwallKeyRejectedError = class extends PowerwallAuthenticationError {};
22
+ /** The gateway answered 429 or 503. Back off before retrying. */
23
+ var PowerwallRateLimitError = class extends PowerwallError {
24
+ failover_safe = true;
25
+ };
26
+ /** The gateway answered with something unexpected, such as a bad protobuf or JSON body. */
27
+ var PowerwallProtocolError = class extends PowerwallError {};
28
+ /** A signed request came back with a non-zero `message_fault`. */
29
+ var PowerwallFaultError = class extends PowerwallError {
30
+ /** The fault's enum name. */
31
+ fault;
32
+ constructor(fault, message, options) {
33
+ super(message ?? `Powerwall returned message fault: ${fault}`, options);
34
+ this.fault = fault;
35
+ }
36
+ };
37
+ /** The gateway answered a command with `common.error_response`, or refused it with a result code. */
38
+ var PowerwallCommandError = class extends PowerwallProtocolError {
39
+ command;
40
+ code;
41
+ status_message;
42
+ constructor(command, code, status_message) {
43
+ super(`Powerwall rejected ${command}: ${status_message || "no message"} (status code ${code})`);
44
+ this.command = command;
45
+ this.code = code;
46
+ this.status_message = status_message;
47
+ }
48
+ };
49
+ /** The gateway firmware does not implement the command: status code 12, `UNIMPLEMENTED`. */
50
+ var PowerwallNotSupportedError = class extends PowerwallCommandError {};
51
+ export { PowerwallAuthenticationError, PowerwallCommandError, PowerwallConnectionError, PowerwallError, PowerwallFaultError, PowerwallKeyRejectedError, PowerwallNotSupportedError, PowerwallProtocolError, PowerwallRateLimitError };