diff options
author | cheapie <no-email-for-you@example.com> | 2016-05-09 13:54:36 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2016-05-09 13:54:36 -0500 |
commit | 34ff6b708d210438401fe4d6db73bb0eb47e61d6 (patch) | |
tree | 81b477c19ecaa6b3980e785d78e0fc21e2e33f6d | |
parent | d447488a1043a24f2bdfc9a063c80aec1637f185 (diff) | |
download | roads-34ff6b708d210438401fe4d6db73bb0eb47e61d6.tar roads-34ff6b708d210438401fe4d6db73bb0eb47e61d6.tar.gz roads-34ff6b708d210438401fe4d6db73bb0eb47e61d6.tar.bz2 roads-34ff6b708d210438401fe4d6db73bb0eb47e61d6.tar.xz roads-34ff6b708d210438401fe4d6db73bb0eb47e61d6.zip |
Allow the yellow light to be controlled by software, and add "FLASHYELLOW" as an alias for "WARN"
-rw-r--r-- | trafficlight/init.lua | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/trafficlight/init.lua b/trafficlight/init.lua index 7f472e0..9a94628 100644 --- a/trafficlight/init.lua +++ b/trafficlight/init.lua @@ -20,8 +20,10 @@ streets.tlBox = { streets.tlRhythm = { toRed = { - {name = "streets:trafficlight_top_yellow", pauseBefore = 0}, - {name = "streets:trafficlight_top_red", pauseBefore = 3} + {name = "streets:trafficlight_top_red", pauseBefore = 0} + }, + toYellow = { + {name = "streets:trafficlight_top_yellow", pauseBefore = 0} }, toGreen = { {name = "streets:trafficlight_top_green", pauseBefore = 0} @@ -39,8 +41,10 @@ streets.tlRhythm = { streets.tlRhythm_left = { toRed = { - {name = "streets:trafficlight_top_left_yellow", pauseBefore = 0}, - {name = "streets:trafficlight_top_left_red", pauseBefore = 3} + {name = "streets:trafficlight_top_left_red", pauseBefore = 0} + }, + toYellow = { + {name = "streets:trafficlight_top_left_yellow", pauseBefore = 0} }, toGreen = { {name = "streets:trafficlight_top_left_green", pauseBefore = 0} @@ -58,8 +62,10 @@ streets.tlRhythm_left = { streets.tlRhythm_right = { toRed = { - {name = "streets:trafficlight_top_right_yellow", pauseBefore = 0}, - {name = "streets:trafficlight_top_right_red", pauseBefore = 3} + {name = "streets:trafficlight_top_right_red", pauseBefore = 0} + }, + toYellow = { + {name = "streets:trafficlight_top_right_yellow", pauseBefore = 0} }, toGreen = { {name = "streets:trafficlight_top_right_green", pauseBefore = 0} @@ -131,6 +137,16 @@ streets.on_digiline_receive = function(pos, node, channel, msg) pos = pos, to = "toWarn" }) + elseif msg == "FLASHYELLOW" then + streets.tlSwitch({ + pos = pos, + to = "toWarn" + }) + elseif msg == "YELLOW" then + streets.tlSwitch({ + pos = pos, + to = "toYellow" + }) elseif msg == "FLASHRED" then streets.tlSwitch({ pos = pos, |