From dd39049d36a4ec34c6bc11936c3f680cd31b24c9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 22 Oct 2020 22:18:22 +0200 Subject: mode-button: use user-led for visual feeback The user-led needs to be configured with type=off, it is ignored with other configuration. --- mode-button | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mode-button') diff --git a/mode-button b/mode-button index 242cb46..3aee63e 100644 --- a/mode-button +++ b/mode-button @@ -32,13 +32,15 @@ :if ([ :len $Code ] > 0) do={ $LogPrintExit info ("Acting on " . $Count . " mode-button presses: " . $Code) false; - :if ([ / system routerboard settings get silent-boot ] = false) do={ - :for I from=1 to=$Count do={ + :for I from=1 to=$Count do={ + / system leds set type=on [ find where leds="user-led" type=off ]; + :if ([ / system routerboard settings get silent-boot ] = false) do={ :beep length=200ms; + } else={ :delay 200ms; } - } else={ - :delay 1s; + / system leds set type=off [ find where leds="user-led" type=on ]; + :delay 200ms; } [ :parse $Code ]; -- cgit v1.2.3-70-g09d2