Просмотр исходного кода

Deal better with Plex not being in the foreground

Zachary Kotlarek 11 лет назад
Родитель
Сommit
72cc694812
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      dmx/projectorPower.pl

+ 10 - 0
dmx/projectorPower.pl

@@ -125,6 +125,16 @@ while (1) {
 	if ($exists{'PLAYING'} && $lastUser < $now) {
 	if ($exists{'PLAYING'} && $lastUser < $now) {
 		$lastUser = $now;
 		$lastUser = $now;
 	}
 	}
+	
+	# Motion counts as activity when Plex is not foreground
+	if (!$exists{'PLEX'} && $mtime{'MOTION'} > $lastUser) {
+		$lastUser = $mtime{'MOTION'};
+	}
+	
+	# Explict no-motion counts as activity when Plex is not foreground
+	if (!$exists{'PLEX'} && $exists{'NO_MOTION'} && $lastUser < $now) {
+		$lastUser = $now;
+	}
 
 
 	# Clear the shutdown timestamp if there is new user activity
 	# Clear the shutdown timestamp if there is new user activity
 	if ($shutdown && (!$exists{'PROJECTOR'} || $lastUser > $shutdown)) {
 	if ($shutdown && (!$exists{'PROJECTOR'} || $lastUser > $shutdown)) {