From 004b3309f0b16bcf0e25c0b83f3b96d0bf395ca6 Mon Sep 17 00:00:00 2001 From: Folf Date: Fri, 15 Dec 2023 12:46:06 +0000 Subject: [PATCH 1/2] autoplay --- spotify/DOCS.md | 5 +++++ spotify/config.yaml | 2 ++ spotify/rootfs/etc/services.d/spotifyd/run | 6 ++++++ spotify/translations/en.yaml | 4 ++++ 4 files changed, 17 insertions(+) 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..b66185f 100644 --- a/spotify/config.yaml +++ b/spotify/config.yaml @@ -15,9 +15,11 @@ init: false options: name: Home Assistant bitrate: 160 + autoplay: true schema: log_level: list(trace|debug|info|notice|warning|error|fatal)? name: str 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. From b9c180b0f605aed1b8bfa254489dad6118652258 Mon Sep 17 00:00:00 2001 From: Folf Date: Fri, 15 Dec 2023 18:01:22 +0000 Subject: [PATCH 2/2] Update spotify/config.yaml Co-authored-by: Jorim Tielemans --- spotify/config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/spotify/config.yaml b/spotify/config.yaml index b66185f..472ce71 100644 --- a/spotify/config.yaml +++ b/spotify/config.yaml @@ -15,7 +15,6 @@ init: false options: name: Home Assistant bitrate: 160 - autoplay: true schema: log_level: list(trace|debug|info|notice|warning|error|fatal)? name: str