From 5eb100a0653e0fbe07efe827c0b0f6a9c07efd5a Mon Sep 17 00:00:00 2001 From: David Jakowenko Date: Sat, 11 Sep 2021 04:02:55 -0400 Subject: [PATCH] feat: allow customizing frigate labels (#95) --- api/src/constants/defaults.js | 1 + api/src/util/frigate.util.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/constants/defaults.js b/api/src/constants/defaults.js index 0099382b..a77486c1 100644 --- a/api/src/constants/defaults.js +++ b/api/src/constants/defaults.js @@ -23,6 +23,7 @@ module.exports = { frigate: { attempts: { latest: 10, snapshot: 0, mqtt: true, delay: 0 }, image: { height: 500 }, + labels: ['person'], }, mqtt: { topics: { diff --git a/api/src/util/frigate.util.js b/api/src/util/frigate.util.js index 4c9404d3..975ed863 100644 --- a/api/src/util/frigate.util.js +++ b/api/src/util/frigate.util.js @@ -48,8 +48,8 @@ module.exports.checks = async ({ return `${id} - skip processing on ${type} events`; } - if (label !== 'person') { - return `${id} - label not a person, ${label} found`; + if (!FRIGATE.LABELS.includes(label)) { + return `${id} - ${label} label not in (${FRIGATE.LABELS.join(', ')})`; } if (IDS.includes(id)) {