Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 47660
EOF
case "$type" in
+ gpio)
+ local gpio inverted
+ json_get_vars gpio inverted
+ uci -q batch <<-EOF
+ set system.$cfg.trigger='gpio'
+ set system.$cfg.gpio='$gpio'
+ set system.$cfg.inverted='$inverted'
+ EOF
+ ;;
+
netdev)
local device
json_get_vars device
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"