Skip to content

Frontier silicon: use correct command to restart stopped stream#168633

Open
wlcrs wants to merge 3 commits intohome-assistant:devfrom
wlcrs:frontier_silicon_restart_stopped_stream
Open

Frontier silicon: use correct command to restart stopped stream#168633
wlcrs wants to merge 3 commits intohome-assistant:devfrom
wlcrs:frontier_silicon_restart_stopped_stream

Conversation

@wlcrs
Copy link
Copy Markdown
Contributor

@wlcrs wlcrs commented Apr 20, 2026

Breaking change

Proposed change

Frontier silicon devices require us to send a 'stop' command to restart a stopped stream instead of sending a 'play' command.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • [] Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the Frontier Silicon media player integration so that restarting playback from a stopped stream uses the device-specific transport command behavior discussed in #164643.

Changes:

  • Track the device PlayState on update so transport logic can branch on STOPPED vs other states.
  • Change async_media_play to send stop() (instead of play()) when the last known state is PlayState.STOPPED.

Comment thread homeassistant/components/frontier_silicon/media_player.py
Comment on lines 284 to +291
async def async_media_play(self) -> None:
"""Send play command."""
await self.fs_device.play()
if self.__play_state == PlayState.STOPPED:
# The 'play' command only seems to work when the current stream is paused.
# We need to send a 'stop' command instead to resume a stopped stream.
await self.fs_device.stop()
else:
await self.fs_device.play()
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

Query the current play status (or otherwise avoid relying on cached state) before choosing between stop() and play(). async_media_play bases its decision on self.__play_state, which is only updated during async_update and can be out of date when the user presses play (or still set from a prior run after an update failure), potentially sending the wrong transport command.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 15:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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.

Out-of-range exception Play/Pause button Roberts i94 via Frontier Silicon integration using Internet Radio

2 participants