hoffmation-base 3.4.5 → 3.4.7

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.
@@ -201,4 +201,16 @@ export declare class API {
201
201
  * @returns The temperature measurements or an error if the device is not found or not a temperature sensor
202
202
  */
203
203
  static getTemperatureHistory(deviceId: string, startDate?: Date, endDate?: Date): Promise<iTemperatureMeasurement[] | Error>;
204
+ /**
205
+ * Generisches Laden eines Konfig-Blobs (z.B. für Express-eigene Settings). Base-agnostisch.
206
+ * @param id - The id of the config to load
207
+ * @returns The config as JSON string or undefined if not found
208
+ */
209
+ static loadConfig(id: string): Promise<string | undefined>;
210
+ /**
211
+ * Generisches Speichern eines Konfig-Blobs. Base-agnostisch — kennt den Inhalt nicht.
212
+ * @param id - The id of the config to save
213
+ * @param data - The config data as JSON string
214
+ */
215
+ static saveConfig(id: string, data: string): void;
204
216
  }
@@ -6,6 +6,7 @@ const enums_1 = require("../enums");
6
6
  const command_1 = require("../command");
7
7
  const logging_1 = require("../logging");
8
8
  const services_1 = require("../services");
9
+ const persistence_1 = require("../services/dbo/persistence");
9
10
  class API {
10
11
  /**
11
12
  * Endpoint to end a scene manually (or early if it has automatic turn off)
@@ -495,5 +496,23 @@ class API {
495
496
  logging_1.ServerLogService.writeLog(enums_1.LogLevel.Debug, `API Call to get temperature history for ${deviceId}`);
496
497
  return d.temperatureSensor.getTemperatureHistory(startDate, endDate);
497
498
  }
499
+ /**
500
+ * Generisches Laden eines Konfig-Blobs (z.B. für Express-eigene Settings). Base-agnostisch.
501
+ * @param id - The id of the config to load
502
+ * @returns The config as JSON string or undefined if not found
503
+ */
504
+ static async loadConfig(id) {
505
+ var _a;
506
+ return (_a = persistence_1.Persistence.dbo) === null || _a === void 0 ? void 0 : _a.loadSettings(id);
507
+ }
508
+ /**
509
+ * Generisches Speichern eines Konfig-Blobs. Base-agnostisch — kennt den Inhalt nicht.
510
+ * @param id - The id of the config to save
511
+ * @param data - The config data as JSON string
512
+ */
513
+ static saveConfig(id, data) {
514
+ var _a;
515
+ (_a = persistence_1.Persistence.dbo) === null || _a === void 0 ? void 0 : _a.persistSettings(id, data, id);
516
+ }
498
517
  }
499
518
  exports.API = API;