diff --git a/airsonos/DOCS.md b/airsonos/DOCS.md index 14a25ee..693d46e 100644 --- a/airsonos/DOCS.md +++ b/airsonos/DOCS.md @@ -44,6 +44,7 @@ port: 49152 latency_rtp: 1000 latency_http: 2000 drift: true +name_format: "%s [AS]" ``` **Note**: _This is just an example, don't copy and past it! Create your own!_ @@ -97,6 +98,13 @@ has to buffer the HTTP audio. Set to `true` to let timing reference drift (no click). +### Option: `name_format` + +Changes how the name of the device is displayed in AirPlay menus. The default +is the speaker name followed by a `+` (e.g., `Main Bedroom+`). You can use a +string with `%s` representing the device's name. For example, setting this +value to `%s [AS]` would show `Main Bedroom [AS]`. + ## Sonos hints and limitations When a Sonos group is created, only the master of that group will appear as diff --git a/airsonos/config.yaml b/airsonos/config.yaml index d9c2832..3e48938 100644 --- a/airsonos/config.yaml +++ b/airsonos/config.yaml @@ -19,6 +19,7 @@ options: latency_rtp: 1000 latency_http: 2000 drift: false + name_format: "%s+" schema: log_level: list(trace|debug|info|notice|warning|error|fatal)? address: str? @@ -26,3 +27,4 @@ schema: latency_rtp: int latency_http: int drift: bool + name_format: str diff --git a/airsonos/rootfs/etc/s6-overlay/s6-rc.d/airsonos/run b/airsonos/rootfs/etc/s6-overlay/s6-rc.d/airsonos/run index 4d77c96..86cc109 100755 --- a/airsonos/rootfs/etc/s6-overlay/s6-rc.d/airsonos/run +++ b/airsonos/rootfs/etc/s6-overlay/s6-rc.d/airsonos/run @@ -51,5 +51,10 @@ if bashio::config.true 'drift'; then options+=(-r) fi +# Set custom name format +if bashio::config.has_value 'name_format'; then + options+=(-n "$(bashio::config 'name_format')") +fi + # Run the AirSonos server exec airsonos "${options[@]}"