From 24b3b8c945d88221c1f870eaad5f55f931274ccc Mon Sep 17 00:00:00 2001 From: Shy Date: Tue, 6 Aug 2024 10:56:01 +0200 Subject: [PATCH] Simplified active_preset(). --- wled | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wled b/wled index 71d3343..9752a5e 100755 --- a/wled +++ b/wled @@ -38,10 +38,9 @@ curl_cmd() { active_preset() { # Find number of active preset. API returns -1 if none is active, we return # an empty string. - preset="$(curl_cmd "http://$1/json" | \ + curl_cmd "http://$1/json" | \ # -1 will be a no-match. - sed -n 's/.*"ps"[[:space:]]*:[[:space:]]*\(1\?[0-9]\).*/\1/p')" - printf '%u' "$preset" + sed -n 's/.*"ps"[[:space:]]*:[[:space:]]*\(1\?[0-9]\).*/\1/p' } # Parse host argument.