Skip to content

Make media_player platform a labs feature for Alexa Devices#170890

Open
jamesonuk wants to merge 9 commits into
home-assistant:devfrom
jamesonuk:ad_media_player_labs
Open

Make media_player platform a labs feature for Alexa Devices#170890
jamesonuk wants to merge 9 commits into
home-assistant:devfrom
jamesonuk:ad_media_player_labs

Conversation

@jamesonuk
Copy link
Copy Markdown
Contributor

@jamesonuk jamesonuk commented May 16, 2026

Proposed change

Make Media Player platform to be introduced in #165825 a labs feature.
This is to allow us to gather feedback on how well this implementation works across a wider audience and more devices.

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:

Copilot AI review requested due to automatic review settings May 16, 2026 11:50
@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @chemelli74, mind taking a look at this pull request as it has been labeled with an integration (alexa_devices) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of alexa_devices can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign alexa_devices Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds an Alexa Devices media player platform behind a Labs preview feature, backed by HTTP/2 push updates, and introduces coordinator support/tests for pushed media/volume state.

Changes:

  • Introduces media_player platform for Alexa Devices with dynamic supported features and service→API mappings.
  • Adds coordinator plumbing for pushed media/volume state plus a sync_media_state() API wrapper with config-entry exceptions.
  • Adds Labs preview feature metadata/strings and extensive test coverage (snapshots + platform/coordinator/init tests).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
homeassistant/components/alexa_devices/__init__.py Gates media player behind Labs, starts/cancels HTTP/2 processing, and forwards/unloads platform dynamically.
homeassistant/components/alexa_devices/coordinator.py Stores pushed media/volume state, wires signal handlers, and adds sync_media_state() error mapping.
homeassistant/components/alexa_devices/media_player.py New MediaPlayer entity implementation using coordinator state and API calls.
homeassistant/components/alexa_devices/manifest.json Declares the alexa_media preview feature metadata.
homeassistant/components/alexa_devices/strings.json Adds preview feature UI strings and an invalid_auth error string.
homeassistant/generated/labs.py Registers Labs metadata for the new preview feature.
tests/components/alexa_devices/conftest.py Extends client fixture with signals + HTTP/2 processing mocks.
tests/components/alexa_devices/test_init.py Adds tests for reauth callback wiring and HTTP/2 task cancellation on unload.
tests/components/alexa_devices/test_coordinator.py Adds tests for push-event handling and sync_media_state() error mapping.
tests/components/alexa_devices/test_media_player.py Adds comprehensive media player behavior and service-call tests + snapshots.
tests/components/alexa_devices/snapshots/test_media_player.ambr Snapshot baseline for entity registry + initial state.

Comment thread homeassistant/components/alexa_devices/strings.json Outdated
Comment thread homeassistant/components/alexa_devices/strings.json Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/coordinator.py Outdated
Comment thread homeassistant/components/alexa_devices/media_player.py Outdated
Copilot AI review requested due to automatic review settings May 16, 2026 12:09
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 10 out of 11 changed files in this pull request and generated 6 comments.

Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread tests/components/alexa_devices/test_coordinator.py Outdated
Comment thread tests/components/alexa_devices/test_init.py
Comment thread homeassistant/components/alexa_devices/media_player.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/strings.json Outdated
Copilot AI review requested due to automatic review settings May 16, 2026 13:06
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 10 out of 11 changed files in this pull request and generated 4 comments.

Comment thread homeassistant/components/alexa_devices/media_player.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/strings.json Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Copilot AI review requested due to automatic review settings May 16, 2026 17:01
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 10 out of 11 changed files in this pull request and generated 5 comments.

Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/coordinator.py
Comment thread homeassistant/components/alexa_devices/strings.json Outdated
Comment thread homeassistant/components/alexa_devices/media_player.py
Copilot AI review requested due to automatic review settings May 20, 2026 12:03
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 10 out of 11 changed files in this pull request and generated 5 comments.

Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/strings.json Outdated
Copilot AI review requested due to automatic review settings May 20, 2026 14:47
@jamesonuk jamesonuk marked this pull request as ready for review May 20, 2026 14:49
@jamesonuk jamesonuk requested a review from chemelli74 as a code owner May 20, 2026 14:49
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 10 out of 11 changed files in this pull request and generated 3 comments.

Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/coordinator.py Outdated
Comment thread homeassistant/components/alexa_devices/media_player.py
@chemelli74 chemelli74 changed the title make media player platform labs feature in alexa devices Make media_player platform a labs feature for Alexa Devices May 28, 2026
@chemelli74 chemelli74 force-pushed the ad_media_player_labs branch from e7c3d04 to e4b1b1e Compare May 28, 2026 16:31
@chemelli74 chemelli74 added this to the 2026.6.0 milestone May 28, 2026
Copilot AI review requested due to automatic review settings May 28, 2026 18:09
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 3 out of 4 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread homeassistant/components/alexa_devices/__init__.py
Copilot AI review requested due to automatic review settings May 28, 2026 18:50
Copy link
Copy Markdown
Contributor

@chemelli74 chemelli74 left a comment

Choose a reason for hiding this comment

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

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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 5 out of 6 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Copilot AI review requested due to automatic review settings June 1, 2026 10:37
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 5 out of 6 changed files in this pull request and generated 4 comments.

Comment thread homeassistant/components/alexa_devices/__init__.py Outdated
Comment thread tests/components/alexa_devices/test_media_player.py
Comment thread tests/components/alexa_devices/test_init.py
Comment thread homeassistant/components/alexa_devices/strings.json Outdated
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.

3 participants