diff --git a/README.md b/README.md index 32b8a64..2219569 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ sudo systemctl start musiccards.service ```bash sudo systemctl status musiccards.service ``` +- Restart service after file update +```bash +sudo systemctl restart musiccards.service +``` ## HomeAssistant Setup for Google Music TO BE CHECKED diff --git a/box.py b/box.py index 4153629..80af598 100755 --- a/box.py +++ b/box.py @@ -43,17 +43,18 @@ while True: cardList.update_list() # Find the card in bdd - card = cardList.get_card(read_id).cmd + card = cardList.get_card(read_id) if card is not None: # Card execution print('Command : ', card.cmd) - print('Modes : ', card.mode) + print('Modes : ', card.str_modes()) - # Update the previous card memory - if (previousCard == read_id) and ("cancel" == cfg.multiReadMode): + if (previousCard == read_id) and ("cancel" == cfg.multiReadMode) and (not card.has_mode("Command")): + # Cancel the read print('Multi read : card canceled') else: + # Update the previous card memory previousCard = read_id if card.has_mode("ClearQueue"): diff --git a/cardList.csv b/cardList.csv index 7a397e3..f55e530 100644 --- a/cardList.csv +++ b/cardList.csv @@ -1,11 +1,13 @@ # Card Id, Command, Mode, Comment +# Command cards +0013397903,playpause, Command, +0013403195,next, Command, +0013354327,volume/+5, Command, +0005690629,volume/-5, Command, + # For Parents -0013397903,playpause, , -0013403195,next, , -0013354327,volume/+5, , -0005690629,volume/-5, , 0013365376,spotify/now/spotify:album:4yYVqX2KierVI3nDV0M2UL, , M - Lettre Infinie 0013193487,spotify/now/spotify:playlist:37i9dQZF1DWXTHBOfJ8aI7, , Légendes du Rock 0003586576,spotify/now/spotify:album:45Hm9e77uZVaRnEIYzzpzM, , Adebert 2 diff --git a/sonosplay.sh b/sonosplay.sh index fa5b0e5..2cae77f 100644 --- a/sonosplay.sh +++ b/sonosplay.sh @@ -5,7 +5,7 @@ addr=$1 # Mendatory - exemple : http://192.168.0.140:5005 cmd=$2 # Mendatory - exemple : volume/50 -echo "Execute the command '$cmd' on the server at '$addr'" +echo "Execute the command $addr/$cmd" # Execute the sonos api request using curl