The Spotify integration only exposes the media_player.play_media
service once it has an active playback context, which doesn't exist
yet on a cold start; the fixed 2s delay after select_source wasn't
long enough in that case even though it always worked once something
had already played. Poll supported_features for the PLAY_MEDIA bit
(up to 8s) before calling play_media instead of guessing a fixed delay.
Also swap the Living Room/Bedroom source_list ID mapping in both the
prompt (for display) and the functions (for select_source) -- it was
backwards.
Adds a test-harness regression case exercising the opaque Spotify
Connect device IDs the source_list actually reports.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Renders the Extended OpenAI Conversation prompt/function definitions and
checks the model's first tool-call choice against test phrases, bypassing
Home Assistant.