From 34ff6b708d210438401fe4d6db73bb0eb47e61d6 Mon Sep 17 00:00:00 2001 From: cheapie Date: Mon, 9 May 2016 13:54:36 -0500 Subject: Allow the yellow light to be controlled by software, and add "FLASHYELLOW" as an alias for "WARN" --- trafficlight/init.lua | 28 ++++++++++++++++++++++------ 1 file 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, -- cgit v1.2.3