diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-26 13:53:06 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-26 13:53:06 +0000 |
commit | 0e0119b6f0f90461b8924507ae38a3201900c3e3 (patch) | |
tree | 211edcac3f697e048eb8f94bea799029fa3fa33f /package/base-files/files/lib/functions/uci-defaults-new.sh | |
parent | aa4c5fd2b0a7c68853970b3b25717fafdf8eb8da (diff) | |
download | upstream-0e0119b6f0f90461b8924507ae38a3201900c3e3.tar.gz upstream-0e0119b6f0f90461b8924507ae38a3201900c3e3.tar.bz2 upstream-0e0119b6f0f90461b8924507ae38a3201900c3e3.zip |
base-files: uci-defaults-new, config_generate: support for gpio leds
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 47660
Diffstat (limited to 'package/base-files/files/lib/functions/uci-defaults-new.sh')
-rwxr-xr-x | package/base-files/files/lib/functions/uci-defaults-new.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/uci-defaults-new.sh b/package/base-files/files/lib/functions/uci-defaults-new.sh index 2ea0742e1e..e79ec99f53 100755 --- a/package/base-files/files/lib/functions/uci-defaults-new.sh +++ b/package/base-files/files/lib/functions/uci-defaults-new.sh @@ -321,6 +321,27 @@ ucidef_set_led_default() { json_select .. } +ucidef_set_led_gpio() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local gpio="$4" + local inverted="$5" + + json_select_object led + + json_select_object "$1" + json_add_string type gpio + json_add_string name "$name" + json_add_string sysfs "$sysfs" + json_add_string trigger "$trigger" + json_add_int gpio "$gpio" + json_add_boolean inverted "$inverted" + json_select .. + + json_select .. +} + ucidef_set_led_rssi() { local cfg="led_$1" local name="$2" |