mirror of
https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git
synced 2025-09-03 13:12:44 +02:00
Ignore motion events when night mode is switched on/off (#1648)
* Ignore motion events if night mode has recently changed. * Add night mode motion delay to web ui * Change night_delay config to night_mode_event_delay
This commit is contained in:
@@ -51,7 +51,8 @@ if [ -n "$F_cmd" ]; then
|
||||
echo "sendTelegram#:#${send_telegram}"
|
||||
echo "telegramAlertType#:#${telegram_alert_type}"
|
||||
echo "sendMatrix#:#${send_matrix}"
|
||||
|
||||
echo "nightModeEventDelay#:#${night_mode_event_delay}"
|
||||
|
||||
;;
|
||||
save_config)
|
||||
if [ -n "${F_motionDetection+x}" ]; then
|
||||
@@ -74,7 +75,7 @@ if [ -n "$F_cmd" ]; then
|
||||
echo -n "Motion color indicator set to "
|
||||
echo -n $(echo $color | cut -d ' ' -f $(($F_motionIndicatorColor + 1)))
|
||||
echo "<br />"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -n "${F_motionTracking+x}" ]; then
|
||||
F_motionTracking=$(printf '%b' "${F_motionTracking//%/\\x}")
|
||||
@@ -221,6 +222,11 @@ if [ -n "$F_cmd" ]; then
|
||||
rewrite_config /system/sdcard/config/motion.conf send_matrix $F_sendMatrix
|
||||
echo "Send Matrix on motion set to $F_sendMatrix<br/>"
|
||||
fi
|
||||
if [ -n "${F_nightModeEventDelay+x}" ]; then
|
||||
F_nightModeEventDelay=$(printf '%b' "${F_nightModeEventDelay//%/\\x}")
|
||||
rewrite_config /system/sdcard/config/motion.conf night_mode_event_delay $F_nightModeEventDelay
|
||||
echo "Motion night mode delay set to $F_nightModeEventDelay<br/>"
|
||||
fi
|
||||
if [ -n "${F_regions+x}" ]; then
|
||||
F_regions=$(printf '%b' "${F_regions//%/\\x}")
|
||||
rewrite_config /system/sdcard/config/motion.conf region_of_interest $F_regions
|
||||
@@ -240,4 +246,3 @@ if [ -n "$F_cmd" ]; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
@@ -273,6 +273,10 @@
|
||||
<option value="true">Activate</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="w3-container">
|
||||
<label>Night mode delay (ignore motion events after switching night mode)</label>
|
||||
<input class="w3-input" id="nightModeEventDelay" type="number" size="6">
|
||||
</div>
|
||||
<p><button class="w3-btn w3-theme" >Save</button></form></p>
|
||||
</div>
|
||||
<!-- Zones Tab -->
|
||||
|
Reference in New Issue
Block a user