From 486cfcd178997c26dd2f8dc79e10b9c7cc8bb6a2 Mon Sep 17 00:00:00 2001 From: TA2k Date: Tue, 27 Aug 2024 20:02:14 +0200 Subject: [PATCH] fix detections states --- main.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 0c8de6c..7d7d7be 100644 --- a/main.js +++ b/main.js @@ -164,10 +164,13 @@ class Frigate extends utils.Adapter { }); await this.initMqtt(); } - async cleanOldObjects(vin) { + async cleanOldObjects() { + await this.delObjectAsync('reviews.before.data.detections', { recursive: true }); + await this.delObjectAsync('reviews.after.data.detections', { recursive: true }); + const remoteState = await this.getObjectAsync('lastidurl'); if (remoteState) { - this.log.info('clean old states ' + vin); + this.log.info('clean old states '); await this.delObjectAsync('', { recursive: true }); } await this.setObjectNotExistsAsync('info.connection', { @@ -289,7 +292,10 @@ class Frigate extends utils.Adapter { const cameraId = pathArray.shift(); pathArray = [cameraId, pathArray.join('_')]; } - + if (pathArray[0] === 'reviews') { + delete data.after.data.detections; + delete data.before.data.detections; + } //create devices state for cameras if (pathArray[0] === 'stats') { delete data['cpu_usages'];