Skip to content

Commit

Permalink
fix detections states
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Aug 27, 2024
1 parent bfbe80a commit 486cfcd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down Expand Up @@ -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'];
Expand Down

0 comments on commit 486cfcd

Please sign in to comment.