aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/bin/config_generate4
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults.sh17
2 files changed, 15 insertions, 6 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 92eb14bb11..28ba0e2694 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -303,11 +303,11 @@ generate_led() {
EOF
;;
- timer)
+ timer|oneshot)
local delayon delayoff
json_get_vars delayon delayoff
uci -q batch <<-EOF
- set system.$cfg.trigger='timer'
+ set system.$cfg.trigger='$type'
set system.$cfg.delayon='$delayon'
set system.$cfg.delayoff='$delayoff'
EOF
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index de3f180cbb..84b78b84ef 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -478,17 +478,18 @@ ucidef_set_led_ide() {
json_select ..
}
-ucidef_set_led_timer() {
+__ucidef_set_led_timer() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
- local delayon="$4"
- local delayoff="$5"
+ local trigger="$4"
+ local delayon="$5"
+ local delayoff="$6"
json_select_object led
json_select_object "$1"
- json_add_string type timer
+ json_add_string type "$trigger"
json_add_string name "$name"
json_add_string sysfs "$sysfs"
json_add_int delayon "$delayon"
@@ -498,6 +499,14 @@ ucidef_set_led_timer() {
json_select ..
}
+ucidef_set_led_oneshot() {
+ __ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5
+}
+
+ucidef_set_led_timer() {
+ __ucidef_set_led_timer $1 $2 $3 "timer" $4 $5
+}
+
ucidef_set_led_rssi() {
local cfg="led_$1"
local name="$2"