myenergi-api 2.2.0 → 2.3.1

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.
@@ -1,3 +1,4 @@
1
+ import { AppKeyValues } from './models/AppKeyValues';
1
2
  import { Eddi } from "./models/Eddi";
2
3
  import { Harvi } from "./models/Harvi";
3
4
  import { KeyValue } from './models/KeyValue';
@@ -19,6 +20,7 @@ export declare class MyEnergi {
19
20
  setEddiBoost(serialNo: string, boost: EddiBoost, minutes?: number): Promise<any>;
20
21
  getStatusHarviAll(): Promise<Harvi[]>;
21
22
  getStatusHarvi(serialNumber: string): Promise<Harvi | null>;
23
+ getAppKeyFull(key: string): Promise<AppKeyValues | null>;
22
24
  getAppKey(key: string): Promise<KeyValue[] | null>;
23
25
  setAppKey(key: string, val: string): Promise<KeyValue[] | null>;
24
26
  }
@@ -228,6 +228,22 @@ class MyEnergi {
228
228
  }
229
229
  });
230
230
  }
231
+ getAppKeyFull(key) {
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ try {
234
+ const data = yield this._digest.get(new URL(`${this._config.get_app_key_url}-${key}`, this._config.base_url));
235
+ const jsonData = JSON.parse(data);
236
+ if (jsonData) {
237
+ const result = Object.assign({}, jsonData);
238
+ return result;
239
+ }
240
+ }
241
+ catch (error) {
242
+ return null;
243
+ }
244
+ return null;
245
+ });
246
+ }
231
247
  getAppKey(key) {
232
248
  return __awaiter(this, void 0, void 0, function* () {
233
249
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myenergi-api",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
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",