Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add librespot initial-volume option #276

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions spotify/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Example add-on configuration:
log_level: info
name: HomeAssistant
bitrate: 320
initial-volume: 50
username: [email protected]
password: MySpotifyPassword
```
Expand Down Expand Up @@ -74,6 +75,10 @@ however, the add-on consumes more data.

Valid values: `96`, `160` (default) or `320`.

### Option: `initial-volume`

Initial volume in % from 0-100. Default for softvol: 50. For the alsa mixer: the current volume.

### Option: `username`

**IMPORTANT**: _This requires a Spotify Premium account!_
Expand Down
2 changes: 2 additions & 0 deletions spotify/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ init: false
options:
name: Home Assistant
bitrate: 160
initial-volume: 50
spoetnik marked this conversation as resolved.
Show resolved Hide resolved
schema:
log_level: list(trace|debug|info|notice|warning|error|fatal)?
name: str
bitrate: list(96|160|320)
username: str?
password: password?
initial-volume: match(^([0-9]|[1-9][0-9]|100)$)?
4 changes: 4 additions & 0 deletions spotify/rootfs/etc/services.d/spotifyd/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ declare bitrate
declare name
declare password
declare username
declare initial-volume

bashio::log.info 'Starting the Spotify daemon...'

# Bitrate
options+=(--bitrate $(bashio::config 'bitrate'))

# Initial Volume
options+=(--initial-volume $(bashio::config 'initial-volume'))

# Device name
name=$(bashio::config 'name')
options+=(--name "${name}")
Expand Down
6 changes: 6 additions & 0 deletions spotify/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ configuration:
description: >-
The bitrate Spotify should use. The higher, the better the sound quality,
however, the add-on consumes more data.
initial-volume:
name: Initial Volume
description: >-
Initial volume in % from 0-100.
Default for softvol: 50.
For the alsa mixer: the current volume.
username:
name: Spotify username
description: >-
Expand Down
6 changes: 6 additions & 0 deletions spotify/translations/hu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ configuration:
description: >-
A Spotify által használt bitráta beállítása. Minél magasabb, annál jobb
minőségű, viszont ez nagyobb adatforgalommal jár.
initial-volume:
name: Initial Volume
description: >-
Kezdeti térfogat %-ban 0-100 között.
A softvol alapértelmezett értéke: 50.
Az alsa keverő esetében: az aktuális térfogat.
username:
name: Spotify felhasználónév
description: >-
Expand Down
6 changes: 6 additions & 0 deletions spotify/translations/it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ configuration:
description: >-
Il bitrate che Spotify dovrebbe usare. Piú é alto, migliore é la qualitá sonora,
tuttavia, l'add-on consumerá piú banda.
initial-volume:
name: Initial Volume
description: >-
Volume iniziale in % da 0 a 100.
Impostazione predefinita per softvol: 50.
Per il mixer alsa: il volume attuale.
username:
name: Spotify username
description: >-
Expand Down
Loading