diff --git a/spotify/DOCS.md b/spotify/DOCS.md index efb2e13..c2827ca 100644 --- a/spotify/DOCS.md +++ b/spotify/DOCS.md @@ -37,6 +37,7 @@ name: HomeAssistant bitrate: 320 username: frenck@example.com password: MySpotifyPassword +autoplay: true ``` **Note**: _This is just an example, don't copy and paste it! Create your own!_ @@ -88,6 +89,10 @@ to disallow guests on your network to use the add-on. The password you use to login to your Spotify Premium account. +### Option: `autoplay` + +Whether Spotify should autoplay similar songs when reaching the end of the queue. + ## Known issues and limitations - This add-on requires a Spotify Premium account. diff --git a/spotify/config.yaml b/spotify/config.yaml index d0a4528..472ce71 100644 --- a/spotify/config.yaml +++ b/spotify/config.yaml @@ -21,3 +21,4 @@ schema: bitrate: list(96|160|320) username: str? password: password? + autoplay: bool diff --git a/spotify/rootfs/etc/services.d/spotifyd/run b/spotify/rootfs/etc/services.d/spotifyd/run index e77f9a4..d26d4d2 100755 --- a/spotify/rootfs/etc/services.d/spotifyd/run +++ b/spotify/rootfs/etc/services.d/spotifyd/run @@ -8,6 +8,7 @@ declare bitrate declare name declare password declare username +declare autoplay bashio::log.info 'Starting the Spotify daemon...' @@ -29,6 +30,11 @@ if bashio::config.has_value 'username'; then options+=(--password "${password}") fi +# Autoplay +if bashio::config.true 'autoplay'; then + options+=(--autoplay) +fi + # Save writes options+=(--disable-audio-cache) diff --git a/spotify/translations/en.yaml b/spotify/translations/en.yaml index 94e5b72..18f5108 100644 --- a/spotify/translations/en.yaml +++ b/spotify/translations/en.yaml @@ -23,3 +23,7 @@ configuration: name: Spotify password description: >- The password to log into your Spotify Premium account with. + autoplay: + name: Autoplay + description: >- + Whether Spotify should autoplay similar songs at the end of the queue.