hoffmation-base 3.7.1 → 3.7.2

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.
@@ -11,6 +11,8 @@ class UnifiLogger {
11
11
  debug(message, ...parameters) {
12
12
  logging_1.ServerLogService.writeLog(enums_1.LogLevel.Debug, (0, node_util_1.format)(message, ...parameters), {
13
13
  source: this.source,
14
+ // Several per second since v5 --> opt-in via logSettings.debugUnifi.
15
+ debugType: enums_1.LogDebugType.UnifiLibrary,
14
16
  });
15
17
  }
16
18
  error(message, ...parameters) {
@@ -9,5 +9,6 @@ export declare enum LogDebugType {
9
9
  DaikinSuccessfullControlInfo = 7,
10
10
  EuroHeaterValveLogging = 8,
11
11
  Trilateration = 9,
12
- DachsUnreach = 10
12
+ DachsUnreach = 10,
13
+ UnifiLibrary = 11
13
14
  }
@@ -14,4 +14,5 @@ var LogDebugType;
14
14
  LogDebugType[LogDebugType["EuroHeaterValveLogging"] = 8] = "EuroHeaterValveLogging";
15
15
  LogDebugType[LogDebugType["Trilateration"] = 9] = "Trilateration";
16
16
  LogDebugType[LogDebugType["DachsUnreach"] = 10] = "DachsUnreach";
17
+ LogDebugType[LogDebugType["UnifiLibrary"] = 11] = "UnifiLibrary";
17
18
  })(LogDebugType || (exports.LogDebugType = LogDebugType = {}));
@@ -44,6 +44,11 @@ export interface iLogSettings {
44
44
  * Whether to log debug messages for trilateration calculations
45
45
  */
46
46
  debugTrilateration?: boolean;
47
+ /**
48
+ * Whether to log debug messages of the Unifi-Protect/Access libraries.
49
+ * @remarks Off by default, as the libraries report every unclassified realtime packet, which is several per second.
50
+ */
51
+ debugUnifi?: boolean;
47
52
  /**
48
53
  * Whether to send telegram messages on "HOST Unreach" of Dachs
49
54
  */
@@ -60,7 +60,7 @@ class ServerLogService {
60
60
  * @returns If the Message should be skipped
61
61
  */
62
62
  static checkDebugLogSkip(debugType) {
63
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
63
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
64
64
  switch (debugType) {
65
65
  case enums_1.LogDebugType.None:
66
66
  return false;
@@ -109,6 +109,11 @@ class ServerLogService {
109
109
  return false;
110
110
  }
111
111
  break;
112
+ case enums_1.LogDebugType.UnifiLibrary:
113
+ if (((_k = this.settingsProvider.settings.logSettings) === null || _k === void 0 ? void 0 : _k.debugUnifi) === true) {
114
+ return false;
115
+ }
116
+ break;
112
117
  }
113
118
  return true;
114
119
  }
@@ -296,12 +296,12 @@ BEGIN
296
296
  END IF;
297
297
 
298
298
  IF (SELECT to_regclass('hoffmation_schema."AirQualitySensorDeviceData"') IS NULL) Then
299
+ -- Deliberately without a foreign key on "DeviceInfo": creating one needs the REFERENCES privilege on
300
+ -- that table, which an existing installation whose tables were created by another role may not grant.
301
+ -- The sibling tables only get away with it because their CREATE is skipped once they exist.
299
302
  create table if not exists hoffmation_schema."AirQualitySensorDeviceData"
300
303
  (
301
- "deviceID" varchar(60) not null
302
- constraint "AirQualitySensorDeviceData_DeviceInfo_null_fk"
303
- references hoffmation_schema."DeviceInfo"
304
- on delete set null,
304
+ "deviceID" varchar(60) not null,
305
305
  aqi double precision,
306
306
  co2 double precision,
307
307
  nox double precision,