Skip to content

Commit

Permalink
Merge pull request #252 from jthoenes/add-music-assistant-support
Browse files Browse the repository at this point in the history
feat: Add support for Music Assistant automations using Music Tags
  • Loading branch information
adonno authored Jun 20, 2024
2 parents 0f5bada + 7fcd7dd commit 3a47f3a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tagreader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,18 @@ pn532_i2c:
size_t spotify = payload.find("https://open.spotify.com");
size_t sonos = payload.find("sonos-2://");
size_t mass_deezer = payload.find("deezer://");
size_t mass_filesystem_local = payload.find("filesystem_local://");
size_t mass_filesystem_smb = payload.find("filesystem_smb://");
size_t mass_plex = payload.find("plex://");
size_t mass_qobuz = payload.find("qobuz://");
size_t mass_radiobrowser = payload.find("radiobrowser://");
size_t mass_soundcloud = payload.find("soundcloud://");
size_t mass_spotify = payload.find("spotify://");
size_t mass_tidal = payload.find("tidal://");
size_t mass_tunein = payload.find("tunein://");
size_t mass_ytmusic = payload.find("ytmusic://");
if (type == "U" and hass != std::string::npos ) {
ESP_LOGD("tagreader", "Found Home Assistant tag NDEF");
id(source)="hass";
Expand All @@ -289,6 +301,21 @@ pn532_i2c:
id(source)="sonos";
id(url)=payload;
}
else if (type == "U" && (mass_deezer != std::string::npos ||
mass_filesystem_local != std::string::npos ||
mass_filesystem_smb != std::string::npos ||
mass_plex != std::string::npos ||
mass_qobuz != std::string::npos ||
mass_radiobrowser != std::string::npos ||
mass_soundcloud != std::string::npos ||
mass_spotify != std::string::npos ||
mass_tidal != std::string::npos ||
mass_tunein != std::string::npos ||
mass_ytmusic != std::string::npos)) {
ESP_LOGD("tagreader", "Found Music Assistant tag NDEF");
id(source) = "mass";
id(url) = payload;
}
else if (type == "T" ) {
ESP_LOGD("tagreader", "Found music info tag NDEF");
id(info)=payload;
Expand Down

0 comments on commit 3a47f3a

Please sign in to comment.