hoffmation-base 3.7.0 → 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.
- package/lib/devices/unifi/own-unifi-air-quality-sensor.js +2 -0
- package/lib/devices/unifi/own-unifi-camera.js +2 -0
- package/lib/devices/unifi/unifi-logger.js +2 -0
- package/lib/enums/log-debug-type.d.ts +2 -1
- package/lib/enums/log-debug-type.js +1 -0
- package/lib/interfaces/iLogSettings.d.ts +5 -0
- package/lib/logging/log-service.js +6 -1
- package/lib/services/dbo/postgreSqlPersist.js +4 -4
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,8 @@ class OwnUnifiAirQualitySensor extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
33
33
|
this._sensor = null;
|
|
34
34
|
this._lastReportedTemperature = undefined;
|
|
35
35
|
this._lastReportedHumidity = undefined;
|
|
36
|
+
// The projection reaches back into the Protect client, whose object graph is self-referential.
|
|
37
|
+
this.jsonOmitKeys.push('_sensor');
|
|
36
38
|
this.deviceCapabilities.push(enums_1.DeviceCapability.temperatureSensor);
|
|
37
39
|
this.deviceCapabilities.push(enums_1.DeviceCapability.humiditySensor);
|
|
38
40
|
this.deviceCapabilities.push(enums_1.DeviceCapability.airQualitySensor);
|
|
@@ -16,6 +16,8 @@ class OwnUnifiCamera extends index_1.CameraDevice {
|
|
|
16
16
|
this.currentImageLink = '';
|
|
17
17
|
// @ts-expect-error Kamera-Projektion wird später verwendet
|
|
18
18
|
this._camera = null;
|
|
19
|
+
// The projection reaches back into the Protect client, whose object graph is self-referential.
|
|
20
|
+
this.jsonOmitKeys.push('_camera');
|
|
19
21
|
this.unifiCameraName = unifiCameraName;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
@@ -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) {
|
|
@@ -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,
|