hoffmation-base 3.0.0-beta.1 → 3.0.0-beta.3

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.
@@ -44,6 +44,7 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
44
44
  Kd: 9, // PID: Kd in 1/1000
45
45
  });
46
46
  this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.heater);
47
+ this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.temperatureSensor);
47
48
  this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.batteryDriven);
48
49
  this._setAutomaticModeId = `${this.info.fullID}.tmp.automaticTemperatureControl`;
49
50
  this._setExternalTempId = `${this.info.fullID}.ext.temperature`;
@@ -39,6 +39,7 @@ class ZigbeeHeater extends zigbeeDevice_1.ZigbeeDevice {
39
39
  });
40
40
  this._seasonTurnOff = false;
41
41
  this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.heater);
42
+ this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.temperatureSensor);
42
43
  this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.batteryDriven);
43
44
  this._iAutomaticInterval = services_1.Utils.guardedInterval(this.checkAutomaticChange, 300000, this); // Alle 5 Minuten prüfen
44
45
  services_1.TimeCallbackService.addCallback(new models_1.TimeCallback(`${this.info.fullID} Season Check`, models_1.TimeCallbackType.TimeOfDay, () => {
@@ -318,7 +318,7 @@ BEGIN
318
318
  create table if not exists hoffmation_schema."Settings"
319
319
  (
320
320
  "id" varchar(60) not null,
321
- "settings" varchar not null,
321
+ "settings" jsonb not null,
322
322
  "customname" varchar(100) not null,
323
323
  date timestamp not null,
324
324
  constraint settings_pk
@@ -342,6 +342,12 @@ BEGIN
342
342
  alter table hoffmation_schema."EnergyCalculation"
343
343
  add "batteryLevel" double precision;
344
344
  END IF;
345
+ IF (SELECT pg_typeof(settings) = to_regtype('varchar')
346
+ FROM hoffmation_schema."Settings"
347
+ LIMIT 1) THEN
348
+ alter table hoffmation_schema."Settings"
349
+ alter column settings type jsonb using settings::jsonb;
350
+ END IF;
345
351
  END
346
352
  $$;`);
347
353
  this.initialized = true;
@@ -477,7 +483,7 @@ values ('${id}','${settings}','${customName}', '${new Date().toISOString()}')
477
483
  }
478
484
  /** @inheritDoc */
479
485
  async loadSettings(id) {
480
- const dbResult = await this.query(`SELECT settings, id, date
486
+ const dbResult = await this.query(`SELECT settings::text, id, date
481
487
  from hoffmation_schema."Settings"
482
488
  WHERE "id" = '${id}'
483
489
  ORDER BY "date" DESC