Simplified active_preset().
This commit is contained in:
parent
d08e07fd72
commit
24b3b8c945
1 changed files with 2 additions and 3 deletions
5
wled
5
wled
|
@ -38,10 +38,9 @@ curl_cmd() {
|
||||||
active_preset() {
|
active_preset() {
|
||||||
# Find number of active preset. API returns -1 if none is active, we return
|
# Find number of active preset. API returns -1 if none is active, we return
|
||||||
# an empty string.
|
# an empty string.
|
||||||
preset="$(curl_cmd "http://$1/json" | \
|
curl_cmd "http://$1/json" | \
|
||||||
# -1 will be a no-match.
|
# -1 will be a no-match.
|
||||||
sed -n 's/.*"ps"[[:space:]]*:[[:space:]]*\(1\?[0-9]\).*/\1/p')"
|
sed -n 's/.*"ps"[[:space:]]*:[[:space:]]*\(1\?[0-9]\).*/\1/p'
|
||||||
printf '%u' "$preset"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Parse host argument.
|
# Parse host argument.
|
||||||
|
|
Loading…
Reference in a new issue