From 96877df4dc3ad40c2f68e136667142a0b0ad45bc Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Sat, 26 Dec 2020 10:51:54 +0100 Subject: [PATCH] sonos.sh Feature: +switch status light --- sonos.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sonos.sh b/sonos.sh index b3fbec6..50a6857 100755 --- a/sonos.sh +++ b/sonos.sh @@ -323,7 +323,7 @@ option_13() { # Mute OFF option_14() { - #playing="Playing Deezer Flow..." <= Shazaaam + playing="" echo -e "\n\033[1m Mute OFF... \033[0m" sonos $loc $device mute off && sleep 2 } @@ -565,6 +565,34 @@ shazam() { sleep 2.5 #read -p "< Press Enter>" } + +# Switch status light +led() { + playing="Switch status light..." + echo -e "\n\033[1m $playing \033[0m" + + led=$(sonos $loc $device status_light) + echo -e "Status light is ${bold}$led${reset}" + + if [[ "$led" == "on" ]]; then + + echo -e "${italic} ...Switching status light off${reset}" + sleep 0.5 + sonos $loc $device status_light off + status="OFF" + #echo -e "Status light is ${bold}off${reset}" + elif [[ "$led" == "off" ]]; then + echo -e "${italic} ...Switching status light on${reset}" + sleep 0.5 + sonos $loc $device status_light on + status="ON" + #echo -e "Status light is ${bold}on${reset}" + fi + + echo -e "Status light is ${bold}$status${reset}" + playing="Status light $status..." + sleep 1.5 + } # Soco device Lists Menu