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

Lock the garage door when LOCK is asserted

Zachary Kotlarek 12 лет назад
Родитель
Сommit
683b9d41d1
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      dmx/garage.pl

+ 9 - 0
dmx/garage.pl

@@ -96,6 +96,15 @@ while (1) {
 		$update = 0;
 	}
 
+	# Do not operate when LOCKed
+	if ($update && $exists{'LOCK'}) {
+		DMX::say('Garage door locked');
+		if ($exists{'GARAGE_CMD'}) {
+			DMX::say('Access denied to: ' . $exists{'GARAGE_CMD'});
+		}
+		$update = 0;
+	}
+
 	# Update the relay
 	if ($update) {