Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generic media control commands #50

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

webmeister
Copy link

For TUNER, maps onto the same commands in the end, but now supports also other sources.

For TUNER, maps onto the same commands in the end, but now supports also
other sources.
if pioneer.source.get(self.zone) == SOURCE_TUNER:
features |= MediaPlayerEntityFeature.PREVIOUS_TRACK
features |= MediaPlayerEntityFeature.NEXT_TRACK
control_commands = pioneer.get_supported_media_controls(self.zone)
Copy link
Owner

Choose a reason for hiding this comment

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

This section needs to be conditional on the currently active source supporting media controls. As it stands, this code removes the capability of using previous/next track when the tuner is active.

async def async_media_previous_track(self) -> None:
"""Send previous track command."""

async def tuner_previous_preset() -> None:
await self.pioneer.tuner_previous_preset()
async def media_previous_track() -> None:
Copy link
Owner

Choose a reason for hiding this comment

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

The media_previous_track and media_next_track methods need to execute the media control commands conditional on the currently active source supporting media controls, without removing the ability to change between tuner presets when the tuner is the active source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants