Skip to content

Conversation

@charlieoleary
Copy link

@charlieoleary charlieoleary commented Nov 9, 2025

Proposed Changes

By default, the name of an AirSonos device is set to the name of the speaker with a + appended to it. This change allows a user to set the default name format for newly discovered speakers by using the native -n command option. The reason for this is to allow more customization for how a device appears in your AirPlay list.

Related Issues

N/A

Summary by CodeRabbit

  • New Features

    • Added a configurable device name format for AirPlay display so users can customize how their device appears in AirPlay menus (supports inserting the device name into a format string).
  • Documentation

    • Added documentation describing the name format option, usage examples, and expected behavior.

@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

Walkthrough

Adds a new name_format configuration option, documents its usage and example, and updates the service run script to pass the configured format as a -n "<value>" argument when starting the AirSonos server.

Changes

Cohort / File(s) Summary
Documentation
airsonos/DOCS.md
Adds name_format option documentation, describes %s placeholder and gives examples (e.g., %s [AS]).
Configuration
airsonos/config.yaml
Registers name_format under options with default value "%s+" and updates schema to accept a string.
Runtime script
airsonos/rootfs/etc/s6-overlay/s6-rc.d/airsonos/run
Reads name_format config and, if present, appends -n "<value>" to the options array before launching the AirSonos server.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Init as init system
  participant Run as run script
  participant Conf as config file
  participant AS as AirSonos server

  Init->>Run: start service
  Run->>Conf: read configuration (including name_format)
  alt name_format present
    Run->>Run: append -n "<name_format>" to options
  end
  Run->>AS: exec AirSonos with options (including -n if set)
  AS-->>Run: startup complete
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to the -n flag semantics in run to ensure it matches the AirSonos binary's expected argument.
  • Confirm the default "%s+" in config.yaml aligns with the DOCS.md examples (which also show alternates like %s [AS]).

Poem

🐇 I hopped through lines of config bright,

%s in paws, a new name to write,
From docs to run, the flag takes flight,
AirPlay blossoms in evening light. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main objective: adding support for a custom name_format configuration option across documentation, config schema, and runtime script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd7595 and 34667ce.

📒 Files selected for processing (2)
  • airsonos/DOCS.md (2 hunks)
  • airsonos/config.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • airsonos/config.yaml
  • airsonos/DOCS.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
airsonos/DOCS.md (1)

40-47: Consider adding name_format to the example configuration.

The example configuration could be enhanced by including the new name_format option to provide users with a complete reference. However, since the option has a sensible default and the note indicates this is just an example, this is optional.

If you'd like to include it, apply this diff:

 ```yaml
 log_level: info
 address: 192.168.1.234
 port: 49152
 latency_rtp: 1000
 latency_http: 2000
 drift: true
+name_format: "%s [AS]"

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between be034efe939421d9d453779464caf7637c3e9279 and 8dd7595974cdc707b4d85d7d130e424422b8fa1a.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `airsonos/DOCS.md` (1 hunks)
* `airsonos/config.yaml` (1 hunks)
* `airsonos/rootfs/etc/s6-overlay/s6-rc.d/airsonos/run` (1 hunks)

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>airsonos/rootfs/etc/s6-overlay/s6-rc.d/airsonos/run (1)</summary><blockquote>

`54-57`: **LGTM!**

The implementation correctly checks for the presence of the `name_format` configuration value and passes it to the AirSonos server using the `-n` flag. The pattern matches the existing configuration handling in this script, and the value is properly quoted to handle special characters.

</blockquote></details>
<details>
<summary>airsonos/DOCS.md (1)</summary><blockquote>

`100-106`: **LGTM!**

The documentation clearly explains the `name_format` option, including its purpose, default behavior, and placeholder usage. The example showing `%s [AS]` → `Main Bedroom [AS]` is particularly helpful for users.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant