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

Add play_media service #503

Merged
merged 3 commits into from Jul 21, 2021
Merged

Conversation

dgomes
Copy link
Contributor

@dgomes dgomes commented Oct 17, 2020

This implements the media_play service which enables programatic channel change

@stale
Copy link

stale bot commented Nov 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 27, 2020
@dgomes
Copy link
Contributor Author

dgomes commented Nov 27, 2020

IMHO this feature still makes sense

@stale stale bot removed the stale label Nov 27, 2020
@stale
Copy link

stale bot commented Jan 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 6, 2021
@dgomes
Copy link
Contributor Author

dgomes commented Jan 6, 2021

not stale 😀

@stale stale bot removed the stale label Jan 6, 2021
@nao-pon
Copy link

nao-pon commented Jan 15, 2021

👍

@stale
Copy link

stale bot commented Mar 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 19, 2021
@dgomes
Copy link
Contributor Author

dgomes commented Mar 20, 2021

:(

@stale stale bot removed the stale label Mar 20, 2021
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 2, 2021
@dgomes
Copy link
Contributor Author

dgomes commented Jun 2, 2021

😢

@stale stale bot removed the stale label Jun 2, 2021
@stale
Copy link

stale bot commented Jul 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 13, 2021
@stale stale bot closed this Jul 20, 2021
@dgomes
Copy link
Contributor Author

dgomes commented Jul 21, 2021

Such a shame....

@stale stale bot removed the stale label Jul 21, 2021
@vassilis-panos
Copy link
Member

I will not comment on whether it is a shame or not.
So does this pull request only work if the source keys are "Channel {integer}"?

@dgomes
Copy link
Contributor Author

dgomes commented Jul 21, 2021

Thank you for replying :)

The all point of the PR is support for changing directly to TV channels >9 which require pressing more than 1 key without any need for external scripts/automations.

The PR just de-multiplexes a large Channel (unsupported) into the composing Channel keys (e.g. Channel 51 -> Channel 5 + Channel 1)

@vassilis-panos
Copy link
Member

That's why I did not accept this PR. Because it only solves your problem and dictates the name of the sources .
An ideal implementation of play_media service is to try to find and map the correct source key, either the media_id is number or string, so you can change channels from voice controllers. For example Alexa, switch to HDMI or Alexa, tune to Fox.
We also need to take into account that we have an “overriding source names” function.
https://github.com/smartHomeHub/SmartIR/blob/master/docs/MEDIA_PLAYER.md#overriding-source-names

@dgomes
Copy link
Contributor Author

dgomes commented Jul 21, 2021

Thank you for your feedback.

I don't think this is only my problem, as I've seen complicated automations to change channels...

MEDIA_TYPE_CHANNEL is supposed to be used for channels only (not sources), channels can have numbers or names (have a look into existing media_players).

If you look into official media_players such as samsungtv and mediaroom you see that the same pattern I followed (only numbers) this is because that is the only thing the underlying platform actually supports (IR blasters don't expose channel names).

If really necessary I can create an overriding channel names feature:

    channel_names:
      Channel 51: BBC
      Channel 12: RTL
      Channel 1: RAI

@vassilis-panos
Copy link
Member

In my opinion, WebOS TV has the right implementation of play_media service.
Ok, I’m going to merge it. It would be great if you could document on how it works.

@vassilis-panos vassilis-panos merged commit 4fb6661 into smartHomeHub:master Jul 21, 2021
@dgomes
Copy link
Contributor Author

dgomes commented Jul 21, 2021

Thanks 🎉

@Dilbert66
Copy link

Glad it was finally added. I had a pull request for similar functionality a while back and there was no response on it so I forked my own version.
#240

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.

None yet

4 participants