File tree Expand file tree Collapse file tree 2 files changed +54
-2
lines changed
Expand file tree Collapse file tree 2 files changed +54
-2
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 " :
Original file line number Diff line number Diff line change 16551655 "isVisible" : 1 ,
16561656 "logicalId" : " SetaiTrack"
16571657 },
1658+ {
1659+ "abilityneed" :" alarmMd" ,
1660+ "name" : " Sensibilité par défaut Detection Mouvement (valeur)" ,
1661+ "type" : " info" ,
1662+ "subtype" : " numeric" ,
1663+ "configuration" : {
1664+ "revertvalue" : " 51" ,
1665+ "payload" : " {\" cmd\" :\" GetMdAlarm\" ,\" action\" :0,\" param\" :{\" channel\" :#CHANNEL#}}"
1666+ },
1667+ "IsHistorized" : 0 ,
1668+ "isVisible" : 0 ,
1669+ "logicalId" : " SetMdDefaultSensitivityState"
1670+ },
1671+ {
1672+ "abilityneed" :" alarmMd" ,
1673+ "name" : " Sensibilité par défaut Detection Mouvement" ,
1674+ "type" : " action" ,
1675+ "subtype" : " slider" ,
1676+ "configuration" : {
1677+ "option" : " slider" ,
1678+ "minValue" : " 1" ,
1679+ "maxValue" : " 50" ,
1680+ "revertvalue" : " 51" ,
1681+ "valueFrom" : " SetMdDefaultSensitivityState" ,
1682+ "actionapi" : " SetMdAlarm" ,
1683+ "payload" : " {\" MdAlarm\" :{\" channel\" :#CHANNEL#,\" newSens\" :{\" sensDef\" :#OPTR_SLIDER#},\" useNewSens\" :1}}"
1684+ },
1685+ "IsHistorized" : 0 ,
1686+ "isVisible" : 1 ,
1687+ "logicalId" : " SetMdDefaultSensitivity"
1688+ },
16581689 {
16591690 "abilityneed" :" supportAiSensitivity" ,
16601691 "iastate" :1 ,
17841815 {
17851816 "abilityneed" :" ptzPreset" ,
17861817 "iastate" :1 ,
1787- "name" : " Point de garde défini (état)" ,
1818+ "name" : " Point de garde (état)" ,
17881819 "type" : " info" ,
17891820 "subtype" : " binary" ,
17901821 "configuration" : {
18561887 {
18571888 "abilityneed" :" ptzPreset" ,
18581889 "iastate" :1 ,
1859- "name" : " Délai Retour auto. au point de garde (état )" ,
1890+ "name" : " Délai Retour auto. au point de garde (valeur )" ,
18601891 "type" : " info" ,
18611892 "subtype" : " numeric" ,
18621893 "Unite" : " s" ,
You can’t perform that action at this time.
0 commit comments