Drop the device name prefix from the media player entity names - #63
Conversation
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)
WalkthroughThe ESPHome configuration shortens the display names of the Sendspin and speaker-source media players by removing the ChangesMedia player names
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
Integrations/ESPHome/Core.yaml
| name: "Sendspin Player" | ||
|
|
||
| - platform: speaker_source | ||
| id: external_media_player | ||
| name: "Apollo CAST-1 Player" | ||
| name: "Player" |
There was a problem hiding this comment.
🗄️ 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' . || trueRepository: 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.
Version: 26.7.27.1 (unchanged)
What does this implement/fix?
Both
media_playerentities inCore.yamlset aname:that already contains the devicefriendly_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_playermedia_player.apollo_cast_1_<mac>_apollo_cast_1_sendspin_playerIn 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 ownwizmote.yamlalready follows that style.This renames them to
PlayerandSendspin Player, givingmedia_player.apollo_cast_1_<mac>_playerandmedia_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
Checklist / Checklijst:
If user-visible functionality or configuration variables are added/modified:
esphome configpasses on bothCAST-1_W.yamlandCAST-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