hoffmation-base 3.2.3 → 3.2.4
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.
|
@@ -140,7 +140,7 @@ class CameraDevice extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
140
140
|
onNewPersonDetectedValue(newValue, source = enums_1.CommandSource.Automatic) {
|
|
141
141
|
this.log(enums_1.LogLevel.Debug, `Update for PersonDetected to value: ${newValue}`);
|
|
142
142
|
if (newValue) {
|
|
143
|
-
this.log(enums_1.LogLevel.Info,
|
|
143
|
+
this.log(enums_1.LogLevel.Info, `Person Detected (${enums_1.CommandSource[source]})`);
|
|
144
144
|
this.resetPersonDetectFallbackTimer();
|
|
145
145
|
}
|
|
146
146
|
this._personDetected = newValue;
|
|
@@ -26,27 +26,29 @@ class OwnUnifiCamera extends index_1.CameraDevice {
|
|
|
26
26
|
this._lastUpdate = new Date();
|
|
27
27
|
}
|
|
28
28
|
checkForMotionUpdate(packet, baseEvent) {
|
|
29
|
-
var _a, _b
|
|
29
|
+
var _a, _b;
|
|
30
30
|
const payload = packet.payload;
|
|
31
31
|
const eventAddInfo = baseEvent !== null && baseEvent !== void 0 ? baseEvent : payload;
|
|
32
32
|
const payloadAsEventAdd = payload;
|
|
33
33
|
if (packet.header.modelKey !== 'smartDetectObject' &&
|
|
34
34
|
(packet.header.modelKey !== 'event' ||
|
|
35
35
|
!['smartDetectLine', 'smartDetectZone'].includes(eventAddInfo.type) ||
|
|
36
|
-
((
|
|
36
|
+
!((_a = payloadAsEventAdd.smartDetectTypes) !== null && _a !== void 0 ? _a : []).length)) {
|
|
37
|
+
// this.log(LogLevel.Debug, `Ignored event: ${JSON.stringify(packet)}`);
|
|
38
|
+
// this.log(LogLevel.Debug, `Ignored event initial Info: ${JSON.stringify(baseEvent)}`);
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
this.log(enums_1.LogLevel.Debug, `Update for "${packet.header.modelKey}" to value: ${JSON.stringify(payload)}`);
|
|
40
42
|
const detectedTypes = packet.header.modelKey === 'smartDetectObject'
|
|
41
43
|
? [payloadAsEventAdd.type]
|
|
42
|
-
: ((
|
|
44
|
+
: ((_b = payloadAsEventAdd === null || payloadAsEventAdd === void 0 ? void 0 : payloadAsEventAdd.smartDetectTypes) !== null && _b !== void 0 ? _b : []);
|
|
43
45
|
for (const smartDetectType of detectedTypes) {
|
|
44
46
|
switch (smartDetectType) {
|
|
45
47
|
case 'licensePlate':
|
|
46
48
|
this.log(enums_1.LogLevel.Debug, `Detected "licensePlate": ${JSON.stringify(payloadAsEventAdd.metadata.licensePlate)}`);
|
|
47
49
|
break;
|
|
48
50
|
case 'person':
|
|
49
|
-
this.onNewPersonDetectedValue(true);
|
|
51
|
+
this.onNewPersonDetectedValue(true, enums_1.CommandSource.Automatic);
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -70,7 +70,7 @@ class UnifiProtect {
|
|
|
70
70
|
this.rememberAddEvent(packet, addEvent);
|
|
71
71
|
}
|
|
72
72
|
else if (packet.header.action === 'update' && this._eventMap.has(id)) {
|
|
73
|
-
baseEvent = this._eventMap.get(
|
|
73
|
+
baseEvent = this._eventMap.get(id);
|
|
74
74
|
id = (_c = (_b = baseEvent === null || baseEvent === void 0 ? void 0 : baseEvent.camera) !== null && _b !== void 0 ? _b : baseEvent === null || baseEvent === void 0 ? void 0 : baseEvent.cameraId) !== null && _c !== void 0 ? _c : '';
|
|
75
75
|
}
|
|
76
76
|
const ownName = this._idMap.get(id);
|