Skip to content

Drop the device name prefix from the media player entity names - #63

Merged
bharvey88 merged 1 commit into
betafrom
fix/media-player-entity-names
Jul 31, 2026
Merged

Drop the device name prefix from the media player entity names#63
bharvey88 merged 1 commit into
betafrom
fix/media-player-entity-names

Conversation

@bharvey88

@bharvey88 bharvey88 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Version: 26.7.27.1 (unchanged)

What does this implement/fix?

Both media_player entities in Core.yaml set a name: that already contains the device friendly_name (Apollo CAST-1). Home Assistant prepends the device name to the entity name, so the result is duplicated:

  • media_player.apollo_cast_1_<mac>_apollo_cast_1_player
  • media_player.apollo_cast_1_<mac>_apollo_cast_1_sendspin_player

In entity pickers and the automation editor these read as "Apollo CAST-1 Apollo CAST-1 Player".

Checked this against every product repo on beta (AIR-1, MSR-1, MSR-2, MTR-1, R_PRO-1, PLT-1, TEMP-1, BTN-1, PUMP-1, CAST-1). A sweep for entity names containing a model code returned exactly two matches, both of them these. No other repo prefixes an entity with its device name, and the house style everywhere else is a short bare label (Uptime, RGB Light, Bluetooth Proxy, Factory Reset ESP). CAST-1's own wizmote.yaml already follows that style.

This renames them to Player and Sendspin Player, giving media_player.apollo_cast_1_<mac>_player and media_player.apollo_cast_1_<mac>_sendspin_player.

Why this is marked breaking: existing owners have automations, scripts, and dashboard cards pointing at the current entity IDs, and those will need updating after this lands. CAST-1 shipped recently so the install base is still small, which is the argument for doing it now rather than later.

No version bump in this PR.

The wiki pages that name these entities (Sensor Definitions, FAQ, TTS and Announcements) need updating in step with the release.

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

esphome config passes on both CAST-1_W.yaml and CAST-1_ETH.yaml, and the rendered config shows both entities with the new names. Not yet flashed to hardware.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Simplified media player display names to “Sendspin Player” and “Player” for a clearer interface.

Both media_player entities set a name that already contains the device
friendly_name, so Home Assistant appends them and produces duplicated
entity IDs like media_player.apollo_cast_1_722124_apollo_cast_1_player,
displayed as "Apollo CAST-1 Apollo CAST-1 Player" in entity pickers.

Every other entity across the fleet uses a short bare label and lets
Home Assistant prepend the device name. These two are the only entities
in any Apollo product repo that repeat their device name.

Renames them to "Player" and "Sendspin Player", which yields
media_player.apollo_cast_1_<mac>_player and
media_player.apollo_cast_1_<mac>_sendspin_player.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The ESPHome configuration shortens the display names of the Sendspin and speaker-source media players by removing the "Apollo CAST-1" prefix.

Changes

Media player names

Layer / File(s) Summary
Rename media players
Integrations/ESPHome/Core.yaml
The media player names change to "Sendspin Player" and "Player".

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: trevorschirmer

Poem

A rabbit hops past the player display,
“Sendspin Player” now leads the way.
The longer prefix has softly fled,
Two tidy names remain instead.
Nibble, deploy, and rest.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes removing the device name prefix from the media player entity names.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/media-player-entity-names

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Integrations/ESPHome/Core.yaml`:
- Around line 338-342: Update all automations, scripts, dashboards, and
documentation that reference the previous Apollo CAST-1-prefixed media-player
entity IDs to use the Home Assistant entities exposed by
sendspin_group_media_player (“Sendspin Player”) and external_media_player
(“Player”). Keep both internal IDs unchanged, and verify the references resolve
correctly for both W and ETH variants.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10b1272c-c8c4-42e1-851f-faef08040bb4

📥 Commits

Reviewing files that changed from the base of the PR and between 4e80e81 and 8fa2fcb.

📒 Files selected for processing (1)
  • Integrations/ESPHome/Core.yaml

Comment on lines +338 to +342
name: "Sendspin Player"

- platform: speaker_source
id: external_media_player
name: "Apollo CAST-1 Player"
name: "Player"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Find old entity-name or entity-ID references outside the renamed definition.
rg -n -i \
  --glob '!Integrations/ESPHome/Core.yaml' \
  'Apollo[[:space:]]+CAST-1|media_player\.apollo_cast_1' . || true

# Confirm both new names and stable internal IDs.
rg -n \
  'id: (sendspin_group_media_player|external_media_player)|name: "(Sendspin Player|Player)"' \
  Integrations/ESPHome/Core.yaml

# Locate both hardware variants for follow-up validation.
fd -t f -a 'CAST-1_(W|ETH)\.yaml$' .

Repository: ApolloAutomation/CAST-1

Length of output: 1110


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== relevant Core.yaml device section =="
sed -n '300,355p' Integrations/ESPHome/Core.yaml

echo
echo "== ESPHome include references =="
rg -n "Core\.yaml|CAST-1_(W|ETH)\.yaml|id: (sendspin_group_media_player|external_media_player)|platform: speaker_source|speaker:" Integrations/ESPHome -g '*.yaml'

echo
echo "== broader Home Assistant-style references in repo =="
rg -n -i \
  --glob '!node_modules/**' \
  --glob '!dist/**' \
  --glob '!build/**' \
  'apollo_cast_1|caster_cast_1|wizmote|sender|media_player|sendspin|player' . || true

Repository: ApolloAutomation/CAST-1

Length of output: 18837


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
import re

core = Path("Integrations/ESPHome/Core.yaml").read_text()
# Extract speaker_source blocks that include id/name in same block.
blocks = re.findall(r'-\s*platform:\s*speaker_source\s+(.*?)\n(?:\n|$)', core, flags=re.S)
for i, b in enumerate(blocks, 1):
    print(f"Speaker source block {i}:")
    for line in b.strip().splitlines():
        print(" ", line)

# Extract nearby internal IDs for the two media player definitions by line ranges.
matches = list(re.finditer(r'id:\s*(sendspin_group_media_player|external_media_player)', core))
for m in matches:
    start=max(0,m.start()-200); end=min(len(core), m.end()+200)
    print(f"\nContext for {m.group(1)}:")
    print(core[start:end])
PY

echo
echo "== YAML device include references (shell) =="
rg -n "Core\.yaml|CAST-1_(W|ETH)\.yaml|esp32|esp8266|project:|platform: speaker_source|speaker:" Integrations/ESPHome -g '*.yaml'

Repository: ApolloAutomation/CAST-1

Length of output: 2951


Update user-facing references for the renamed media player entities.

The internal CSP IDs sendspin_group_media_player and external_media_player stay unchanged, but Home Assistant will expose the names as Sendspin Player and Player. Update all automations, scripts, dashboards, and docs that target the previous Apollo CAST-1 device-prefixed entity IDs. Validate the intended entity names for both the W and ETH variants.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Integrations/ESPHome/Core.yaml` around lines 338 - 342, Update all
automations, scripts, dashboards, and documentation that reference the previous
Apollo CAST-1-prefixed media-player entity IDs to use the Home Assistant
entities exposed by sendspin_group_media_player (“Sendspin Player”) and
external_media_player (“Player”). Keep both internal IDs unchanged, and verify
the references resolve correctly for both W and ETH variants.

@bharvey88
bharvey88 merged commit 2b0004a into beta Jul 31, 2026
9 checks passed
@bharvey88
bharvey88 deleted the fix/media-player-entity-names branch July 31, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant