Explorar o código

Lock the garage door when LOCK is asserted

Zachary Kotlarek %!s(int64=12) %!d(string=hai) anos
pai
achega
683b9d41d1
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  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) {