Add a new script to toggle wifi via mode button

This commit is contained in:
Pothi Kalimuthu 2021-12-22 09:57:20 +05:30
parent 40e85a2ee9
commit 55320e161e

20
scripts/wifi-button.rsc Normal file
View file

@ -0,0 +1,20 @@
# Ref: https://gist.github.com/sebastian13/47e788371474d73552593b621eeacd33
:log info message=("mode button was pressed");
:local i
:if ( [/int wir get 0 disabled ] = true ) do={
:foreach i in= [ /int wir find ] do={ :int wir enable $i };
} else={
:foreach i in= [ /int wir find ] do={ :int wir disable $i };
}
# Wifi disable
# :if ( [/int wir get 0 disabled ] = true ) do={} else={
# :foreach i in= [ /int wir find ] do={ :int wir disable $i };
# }
# Wifi enable
# :if ( [/int wir get 0 disabled ] = true ) do={
# :foreach i in= [ /int wir find ] do={ :int wir enable $i };
# }