diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2026-03-27 20:03:04 +0100 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2026-03-27 20:03:04 +0100 |
| commit | 9f758a3ec0e549f22d1285662f05b0b51a1852df (patch) | |
| tree | 75534936ece960558d9d8ada7924bd1f43e00696 | |
| parent | fe6d2c66791763b69dba1db169cef22c2102645d (diff) | |
Match scene at start of scene name
| -rwxr-xr-x | set.sh | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -31,7 +31,7 @@ fi if [[ $1 = "-s" ]]; then namesubstr=$2 scenes=$(hue_request resource/scene | jq -r '.data.[] | .id + " " + .metadata.name') - matches=$(cut -d' ' -f2- <<<"$scenes" | grep -niF "$namesubstr" | cut -d: -f1 || true) + matches=$(cut -d' ' -f2- <<<"$scenes" | grep -ni "^$namesubstr" | cut -d: -f1 || true) [[ $(wc -l <<<"$matches") -gt 1 ]] && { echo >&2 "Multiple scenes matched, name must be unambiguous"; exit 1; } sceneid=$(sed -n "$matches s/ .*//p" <<<"$scenes") hue_request resource/scene/"$sceneid" PUT '{"recall":{"action":"active"}}' >/dev/null |
