File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,21 @@ public static function updatePTZpreset($id, $data) {
212212 }
213213 }
214214
215+ public static function getRevertValue ($ id ,$ EqLId ) {
216+ foreach (reolinkCmd::byEqLogicId ($ id ) as $ cmd ) {
217+ $ cmdLId = $ cmd ->getLogicalId ();
218+ if ($ cmd ->getType () == "info " && $ cmdLId == $ EqLId ) {
219+ $ RVval = $ cmd ->getConfiguration ('revertvalue ' );
220+ log::add ('reolink ' , 'debug ' , 'cmdLId : ' . $ cmdLId . ' -> revertvalue : ' . $ RVval );
221+ }
222+ }
223+ if ($ RVval != NULL ) {
224+ return $ RVval ;
225+ } else {
226+ return false ;
227+ }
228+ }
229+
215230 public static function refreshNFO ($ id ) {
216231 $ camcmd = reolink::byId ($ id , 'reolink ' );
217232 $ camcnx = reolink::getReolinkConnection ($ id );
@@ -462,6 +477,12 @@ public static function refreshNFO($id) {
462477 $ camcmd ->checkAndUpdateCmd ('SetaiTrackState ' , $ json_data ['value ' ]['aiTrack ' ]);
463478 break ;
464479
480+ case reolinkAPI::CAM_GET_MDALARM :
481+ $ revert_value = reolink::getRevertValue ($ id ,'SetMdDefaultSensitivityState ' );
482+ $ mdsensdef = ($ revert_value - ((int ) $ json_data ['value ' ]['MdAlarm ' ]['newSens ' ]['sensDef ' ]));
483+ $ camcmd ->checkAndUpdateCmd ('SetMdDefaultSensitivityState ' , $ mdsensdef );
484+ break ;
485+
465486 case reolinkAPI::CAM_GET_AIALARM :
466487 switch ($ json_data ['value ' ]['AiAlarm ' ]['ai_type ' ]) {
467488 case "people " :
You can’t perform that action at this time.
0 commit comments