@@ -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