Skip to content

Commit 529326a

Browse files
committed
Fix detect object
1 parent 70e7396 commit 529326a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

core/class/frigate.class.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,19 +2883,18 @@ private static function handleMotion($eqCamera, $key, $innerValue)
28832883

28842884
private static function handleObject($eqCamera, $key, $innerValue)
28852885
{
2886-
if ($innerValue !== 0) {
2887-
$innerValue = 1;
2888-
}
2889-
if (isset($innerValue) && !is_array($innerValue)) {
2886+
// Ne prendre en considération que les détections d'object en mouvement
2887+
if (isset($innerValue["active"])) {
2888+
$value = ($innerValue["active"] !== 0) ? 1 : 0;
28902889
$infoCmd = self::createCmd($eqCamera->getId(), "Détection " . $key, "binary", "", "info_detect_" . $key, "JEEMATE_CAMERA_DETECT_EVENT_STATE", 0);
2891-
$infoCmd->event($innerValue);
2890+
$infoCmd->event($value);
28922891
$infoCmd->save();
2893-
log::add("frigateDetect", 'debug', $eqCamera->getHumanName() . ', Objet : ' . $key . ', Valeur enregistrée : ' . json_encode($innerValue));
2892+
log::add("frigateDetect", 'debug', $eqCamera->getHumanName() . ', Objet : ' . $key . ', Valeur enregistrée : ' . json_encode($value));
28942893
}
28952894
}
28962895
private static function handleAllObject($eqCamera, $key, $innerValue)
28972896
{
2898-
$value = 0;
2897+
// Ne prendre en considération que les détections d'object en mouvement
28992898
if (isset($innerValue["active"])) {
29002899
$value = ($innerValue["active"] !== 0) ? 1 : 0;
29012900
$infoCmd = self::createCmd($eqCamera->getId(), "Détection tout", "binary", "", "info_detect_all", "JEEMATE_CAMERA_DETECT_EVENT_STATE", 0);

0 commit comments

Comments
 (0)