瀏覽代碼

Lock the garage door when LOCK is asserted

Zachary Kotlarek 12 年之前
父節點
當前提交
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) {