[OpenWrt-Devel] base-files:fix a bug when add led timer trigger

Message ID 1543989948-7268-1-git-send-email-wurobinson@qq.com
State Under Review
Delegated to: John Crispin
Headers show
Series
  • [OpenWrt-Devel] base-files:fix a bug when add led timer trigger
Related show

Commit Message

robinson Dec. 5, 2018, 6:05 a.m.
When I tried to add a led timer tirgger in "target/linux/ramips/base-files/
etc/board.d/01_leds" like below
ucidef_set_led_timer "system" "system" "zhuotk:green:system" "1000" "1000"
it will be failed to add value to "delayon" and "delayoff". This commit fix this
bug.

Signed-off-by: robinson <wurobinson@qq.com>
---
 package/base-files/files/lib/functions/uci-defaults.sh | 1 +
 1 file changed, 1 insertion(+)

Comments

John Crispin Dec. 17, 2018, 6:58 a.m. | #1
On 05/12/2018 07:05, robinson wrote:
> When I tried to add a led timer tirgger in "target/linux/ramips/base-files/
> etc/board.d/01_leds" like below
> ucidef_set_led_timer "system" "system" "zhuotk:green:system" "1000" "1000"
> it will be failed to add value to "delayon" and "delayoff". This commit fix this
> bug.
>
> Signed-off-by: robinson <wurobinson@qq.com>

Hi robinson,

Is this your full name of nickname ? we require the full name inside the 
SoB line

     Johnl


> ---
>   package/base-files/files/lib/functions/uci-defaults.sh | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
> index 315df7b..23bde9a 100755
> --- a/package/base-files/files/lib/functions/uci-defaults.sh
> +++ b/package/base-files/files/lib/functions/uci-defaults.sh
> @@ -463,6 +463,7 @@ _ucidef_set_led_timer() {
>   
>   	_ucidef_set_led_common "$1" "$2" "$3"
>   
> +	json_add_string type timer
>   	json_add_string trigger "$trigger_name"
>   	json_add_int delayon "$delayon"
>   	json_add_int delayoff "$delayoff"

Patch

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 315df7b..23bde9a 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -463,6 +463,7 @@  _ucidef_set_led_timer() {
 
 	_ucidef_set_led_common "$1" "$2" "$3"
 
+	json_add_string type timer
 	json_add_string trigger "$trigger_name"
 	json_add_int delayon "$delayon"
 	json_add_int delayoff "$delayoff"