myenergi-api 2.8.1 → 2.9.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.
@@ -17,6 +17,7 @@ export declare class MyEnergi {
17
17
  setZappiBoostMode(serialNo: string, boostMode: ZappiBoostMode, kwh?: number, completeTime?: string): Promise<any>;
18
18
  setZappiGreenLevel(serialNo: string, percentage: number): Promise<any>;
19
19
  setZappiPhaseSetting(serialNo: string, phaseSetting: ZappiPhaseSetting): Promise<any>;
20
+ unlockZappi(serialNo: string): Promise<any>;
20
21
  getDayHourHistory(id: string, year: number, month: number, day: number, startHour?: number, noHours?: number): Promise<HistoryRecord[]>;
21
22
  getStatusLibbiAll(): Promise<Libbi[]>;
22
23
  getStatusLibbi(serialNumber: string): Promise<Libbi | null>;
@@ -29,6 +29,7 @@ class MyEnergi {
29
29
  zappi_min_green_url: "/cgi-set-min-green-Z",
30
30
  zappi_phase_setting_url: "/cgi-zappi-phase-setting-Z",
31
31
  zappi_boost_time_url: "/cgi-boost-time-Z",
32
+ zappi_lock_url: "/cgi-jlock-",
32
33
  eddi_mode_url: "/cgi-eddi-mode-E",
33
34
  eddi_boost_url: "/cgi-eddi-boost-E",
34
35
  get_app_key_url: "/cgi-get-app-key",
@@ -145,6 +146,19 @@ class MyEnergi {
145
146
  }
146
147
  });
147
148
  }
149
+ unlockZappi(serialNo) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ try {
152
+ const url = new URL(`${this._config.zappi_lock_url}${serialNo}-00000010`, this._config.base_url);
153
+ const data = yield this._digest.get(url);
154
+ const jsonData = JSON.parse(data);
155
+ return jsonData;
156
+ }
157
+ catch (error) {
158
+ return {};
159
+ }
160
+ });
161
+ }
148
162
  getDayHourHistory(id, year, month, day, startHour, noHours) {
149
163
  return __awaiter(this, void 0, void 0, function* () {
150
164
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myenergi-api",
3
- "version": "2.8.1",
3
+ "version": "2.9.0",
4
4
  "description": "NodeJS implementation of MyEnergi API for controlling Zappi, Eddi and other MyEnergi products",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",