Zachary Kotlarek 11 anni fa
parent
commit
1611d14ce5
2 ha cambiato i file con 10 aggiunte e 10 eliminazioni
  1. 4 4
      dmx/garage_leds.pl
  2. 6 6
      dmx/garage_shelf.pl

+ 4 - 4
dmx/garage_leds.pl

@@ -1,5 +1,5 @@
-#!/usr/bin/perl
-use strict;
+o    #!/usr/bin/perl
+  use strict;
 use warnings;
 use POSIX;
 use Math::Random;
@@ -108,7 +108,7 @@ while (1) {
 	# Record only valid states
 	if (defined($cmdState)) {
 		$masterState = $cmdState;
-		$pullLast = $now;
+		$pullLast    = $now;
 	}
 
 	# Die if we don't see regular updates
@@ -121,7 +121,7 @@ while (1) {
 	if ($exists{'BRIGHT'}) {
 		$state = 'BRIGHT';
 	} elsif ($mtime{'MOTION_GARAGE'} > $now - $MOTION_TIMEOUT) {
-		$state   = 'MOTION';
+		$state      = 'MOTION';
 		$lastMotion = $now;
 	} elsif ($masterState eq 'PLAY' || $masterState eq 'PAUSE' || $masterState eq 'MOTION') {
 		if ($now > $lastMotion + $POSTMOTION_TIMEOUT) {

+ 6 - 6
dmx/garage_shelf.pl

@@ -12,10 +12,10 @@ use DMX;
 my $MOTION_TIMEOUT     = 30;
 my $POSTMOTION_TIMEOUT = 60;
 my %DIM                = (
-	'OFF'        => [ { 'channel' => 24, 'value' => 0,   'time' => 60000 }, ],
-	'MOTION'     => [ { 'channel' => 24, 'value' => 196, 'time' => 750 }, ],
-	'BRIGHT'     => [ { 'channel' => 24, 'value' => 255, 'time' => 1000 }, ],
-	'ERROR'      => [ { 'channel' => 24, 'value' => 255, 'time' => 100 }, ],
+	'OFF'    => [ { 'channel' => 24, 'value' => 0,   'time' => 60000 }, ],
+	'MOTION' => [ { 'channel' => 24, 'value' => 196, 'time' => 750 }, ],
+	'BRIGHT' => [ { 'channel' => 24, 'value' => 255, 'time' => 1000 }, ],
+	'ERROR'  => [ { 'channel' => 24, 'value' => 255, 'time' => 100 }, ],
 );
 
 # App config
@@ -62,7 +62,7 @@ while (1) {
 	# Record only valid states
 	if (defined($cmdState)) {
 		$masterState = $cmdState;
-		$pullLast = $now;
+		$pullLast    = $now;
 	}
 
 	# Die if we don't see regular updates
@@ -75,7 +75,7 @@ while (1) {
 	if ($exists{'BRIGHT'}) {
 		$state = 'BRIGHT';
 	} elsif ($mtime{'MOTION_GARAGE'} > $now - $MOTION_TIMEOUT) {
-		$state   = 'MOTION';
+		$state = 'MOTION';
 	} else {
 		$state = 'OFF';
 	}