Compare commits
No commits in common. "654b7ff48046d3ebb62f68039f82180446db2585" and "f8bb69594c86e69015247335e68a3062457ae532" have entirely different histories.
654b7ff480
...
f8bb69594c
1 changed files with 2 additions and 12 deletions
14
wled
14
wled
|
@ -13,11 +13,6 @@ VERSION="0.1.3"
|
||||||
exit_code=0
|
exit_code=0
|
||||||
host_list=
|
host_list=
|
||||||
|
|
||||||
# Shell specific options.
|
|
||||||
case "$(readlink /proc/$$/exe)" in
|
|
||||||
*/zsh) setopt SH_WORD_SPLIT ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Make the exit status of command pipelines the status of the last command
|
# Make the exit status of command pipelines the status of the last command
|
||||||
# with non-zero exit status - if supported by this shell.
|
# with non-zero exit status - if supported by this shell.
|
||||||
(set -o pipefail 2>/dev/null) && set -o pipefail
|
(set -o pipefail 2>/dev/null) && set -o pipefail
|
||||||
|
@ -75,15 +70,10 @@ current_brightness() {
|
||||||
sed -n 's/.*"state"[[:space:]]*:[[:space:]]*{[^}]*"bri"[[:space:]]*:[[:space:]]*\([0-9]\{1,3\}\).*/\1/p'
|
sed -n 's/.*"state"[[:space:]]*:[[:space:]]*{[^}]*"bri"[[:space:]]*:[[:space:]]*\([0-9]\{1,3\}\).*/\1/p'
|
||||||
}
|
}
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
print_help
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Parse instance argument and store hostnames.
|
# Parse instance argument and store hostnames.
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h|--help)
|
""|-h|--help) # Missing instance parameter.
|
||||||
print_help
|
print_help
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
@ -141,7 +131,7 @@ for wled_host in $host_list; do
|
||||||
api_resp=$(curl_send "{'ps':$1}" "http://$wled_host/json")
|
api_resp=$(curl_send "{'ps':$1}" "http://$wled_host/json")
|
||||||
;;
|
;;
|
||||||
l|list) # List presets.
|
l|list) # List presets.
|
||||||
test -t 1 && printf 'connecting ...\r'
|
printf "loading ...\r"
|
||||||
active_ps=$(active_preset "$wled_host")
|
active_ps=$(active_preset "$wled_host")
|
||||||
curl_fetch "http://$wled_host/presets.json" | \
|
curl_fetch "http://$wled_host/presets.json" | \
|
||||||
# Insert newline in front of every preset slice.
|
# Insert newline in front of every preset slice.
|
||||||
|
|
Loading…
Add table
Reference in a new issue