From b98e1f4d4f0f8ad7706a30dd90536bae6cd41466 Mon Sep 17 00:00:00 2001 From: Nick Bento Date: Wed, 8 Jan 2025 15:25:05 -0500 Subject: [PATCH 1/4] Update music_assistant_blueprint.yaml with triggers that support area context awareness --- music_assistant_blueprint.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/music_assistant_blueprint.yaml b/music_assistant_blueprint.yaml index 63a1683..671e189 100644 --- a/music_assistant_blueprint.yaml +++ b/music_assistant_blueprint.yaml @@ -82,6 +82,26 @@ triggers: command: - "(play|listen to) [the ]playlist {media_name} (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" id: playlist + - trigger: conversation + command: + - "(play|listen to) [the ](album|ep|record|compilation|single) {media_name} [by [the ](artist|band|group) {artist}] (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" + id: album + - trigger: conversation + command: + - "(play|listen to) [the ](track|song) {media_name} [by [the ](artist|band|group) {artist}] [(with|using) {radio_mode}]" + id: track + - trigger: conversation + command: + - "(play|listen to) [the ](artist|band|group) {media_name} [(with|using) {radio_mode}]" + id: artist + - trigger: conversation + command: + - "(play|listen to) [the ]((radio station)|(radio)|(station)) {media_name}" + id: radio + - trigger: conversation + command: + - "(play|listen to) [the ]playlist {media_name} [(with|using) {radio_mode}]" + id: playlist conditions: [] actions: - variables: From d2b61566c5e9d1122a5a03f457a692d2e5629383 Mon Sep 17 00:00:00 2001 From: Nick Bento Date: Wed, 8 Jan 2025 15:40:56 -0500 Subject: [PATCH 2/4] fixing indentation --- music_assistant_blueprint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/music_assistant_blueprint.yaml b/music_assistant_blueprint.yaml index 671e189..c2a0a09 100644 --- a/music_assistant_blueprint.yaml +++ b/music_assistant_blueprint.yaml @@ -82,7 +82,7 @@ triggers: command: - "(play|listen to) [the ]playlist {media_name} (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" id: playlist - - trigger: conversation + - trigger: conversation command: - "(play|listen to) [the ](album|ep|record|compilation|single) {media_name} [by [the ](artist|band|group) {artist}] (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" id: album From 538fae81b70c539e28f4784d70dd999bd2ce1b14 Mon Sep 17 00:00:00 2001 From: Nick Bento Date: Wed, 8 Jan 2025 15:42:01 -0500 Subject: [PATCH 3/4] Correcting missing commit for album area trigger sentence --- music_assistant_blueprint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/music_assistant_blueprint.yaml b/music_assistant_blueprint.yaml index c2a0a09..d5b2644 100644 --- a/music_assistant_blueprint.yaml +++ b/music_assistant_blueprint.yaml @@ -84,7 +84,7 @@ triggers: id: playlist - trigger: conversation command: - - "(play|listen to) [the ](album|ep|record|compilation|single) {media_name} [by [the ](artist|band|group) {artist}] (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" + - "(play|listen to) [the ](album|ep|record|compilation|single) {media_name} [by [the ](artist|band|group) {artist}] [(with|using) {radio_mode}]" id: album - trigger: conversation command: From 15c44778d82020d6c531b30c57dd24a3fab8736e Mon Sep 17 00:00:00 2001 From: Nick Bento Date: Wed, 8 Jan 2025 15:50:38 -0500 Subject: [PATCH 4/4] refactoring the changes to make the fragments in the original triggers optional Making the area/device portions of the triggers optional instead of re-declaring the triggers to be more efficient/maintainable. --- music_assistant_blueprint.yaml | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/music_assistant_blueprint.yaml b/music_assistant_blueprint.yaml index d5b2644..15a7779 100644 --- a/music_assistant_blueprint.yaml +++ b/music_assistant_blueprint.yaml @@ -64,43 +64,23 @@ blueprint: triggers: - trigger: conversation command: - - "(play|listen to) [the ](album|ep|record|compilation|single) {media_name} [by [the ](artist|band|group) {artist}] (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" + - "(play|listen to) [the ](album|ep|record|compilation|single) {media_name} [by [the ](artist|band|group) {artist}] [(in|on|using) [the ]{area_or_player_name}][ (with|using) {radio_mode}]" id: album - trigger: conversation command: - - "(play|listen to) [the ](track|song) {media_name} [by [the ](artist|band|group) {artist}] (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" + - "(play|listen to) [the ](track|song) {media_name} [by [the ](artist|band|group) {artist}] [(in|on|using) [the ]{area_or_player_name}][ (with|using) {radio_mode}]" id: track - trigger: conversation command: - - "(play|listen to) [the ](artist|band|group) {media_name} (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" + - "(play|listen to) [the ](artist|band|group) {media_name} [(in|on|using) [the ]{area_or_player_name}][ (with|using) {radio_mode}]" id: artist - trigger: conversation command: - - "(play|listen to) [the ]((radio station)|(radio)|(station)) {media_name} (in|on|using) [the ]{area_or_player_name}" + - "(play|listen to) [the ]((radio station)|(radio)|(station)) {media_name} [(in|on|using) [the ]{area_or_player_name}]" id: radio - trigger: conversation command: - - "(play|listen to) [the ]playlist {media_name} (in|on|using) [the ]{area_or_player_name}[ (with|using) {radio_mode}]" - id: playlist - - trigger: conversation - command: - - "(play|listen to) [the ](album|ep|record|compilation|single) {media_name} [by [the ](artist|band|group) {artist}] [(with|using) {radio_mode}]" - id: album - - trigger: conversation - command: - - "(play|listen to) [the ](track|song) {media_name} [by [the ](artist|band|group) {artist}] [(with|using) {radio_mode}]" - id: track - - trigger: conversation - command: - - "(play|listen to) [the ](artist|band|group) {media_name} [(with|using) {radio_mode}]" - id: artist - - trigger: conversation - command: - - "(play|listen to) [the ]((radio station)|(radio)|(station)) {media_name}" - id: radio - - trigger: conversation - command: - - "(play|listen to) [the ]playlist {media_name} [(with|using) {radio_mode}]" + - "(play|listen to) [the ]playlist {media_name} [(in|on|using) [the ]{area_or_player_name}][ (with|using) {radio_mode}]" id: playlist conditions: [] actions: