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

Change keys for Samsung TV next and prev track command #28213

Merged
merged 1 commit into from Nov 15, 2019

Conversation

tulindo
Copy link
Contributor

@tulindo tulindo commented Oct 25, 2019

Breaking Change:

The behaviour for next and previous track commands for samsung TVs were changed.
Before the change the samsung tv component reacted to the two above commands sending the KEY_FF and KEY_REWIND commands. While watching TV programs those two commands do nothing.
After the change the entity sends the KEY_CHUP and KEY_CHDOWN commands instead, thus allowing the user to change channel using the media player standard lovelace interface.
The user doesn't need to change anything in the configuration.

Description:

The best solution would be to send the right command based on the status of the TV (just like in the LG webos component) but unluckily looks like there is no way to detect what the TV currently showing.
Since there is no next/prev command in the media player but only next/prev track one has to deal with this.

Related issue (if applicable): fixes #

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@probot-home-assistant
Copy link

Hey there @escoand, mind taking a look at this pull request as its been labeled with a integration (samsungtv) you are listed as a codeowner for? Thanks!

@escoand
Copy link
Contributor

escoand commented Oct 25, 2019

@tulindo Sorry, but I don't get it. What is working with the current solution? And what is not working with the proposed one?

@tulindo
Copy link
Contributor Author

tulindo commented Oct 26, 2019

@escoand while I watch a TV program on a channel and I want to watch the next channel the Key_ff command doesn't switch channel on TV while key_chup does.
If you want to control TV using Alexa the current implementation of che skip channel command calls the next track media player service and basically does nothing on the Samsung TV (displays only a "not available" string on the TV)
Do you see my point?
That's also why days ago I asked you if there is a way to detect if the Samsung is currently displaying a TV program (in order to send Key_chup instead of Key_ff based on what the TV is doing as in the LG webostv component). We can use the current TV source (send Key_chup if the source is TV otherwise Key_ff) but is not 100% guaranteed
PS: In Italy we call this situation the short blanket problem :-)

@escoand
Copy link
Contributor

escoand commented Oct 26, 2019

How is the button defined in HA? I would say neither KEY_FF nor KEY_CHUP is the correct use for media_next_track. So for me both seem to be wrong but I could also not find a better matching one: https://github.com/kdschlosser/samsungctl#key-codes

A bit more appropriate is KEY_CHUP. It is at least for TV vaguely what you want when hitting the >| button.

@tulindo
Copy link
Contributor Author

tulindo commented Oct 26, 2019

That's exactly my thought... Although it's not the perfect solution it's probably close to the expectation of an average television user.
At least that was my expectation when I pressed that button the first time I configured my TV on HA.
And last but not least it will allow Samsung TV to positively react when asking Alexa to skip to the next channel (Alexa component invokes the next_track command)
So? Let's go for it?
Paolo

@escoand
Copy link
Contributor

escoand commented Oct 26, 2019

LGTM. Would you like to take ownership too?

@tulindo
Copy link
Contributor Author

tulindo commented Oct 26, 2019

Gaining ownership for 2 silly lines of code? I don't think I deserve it :) at least for now.

@escoand
Copy link
Contributor

escoand commented Oct 26, 2019

Deserve? Do I? I was just looking for somebody also willing to bring this integration further.

@tulindo
Copy link
Contributor Author

tulindo commented Oct 26, 2019

Just to understand the PR approval and merge workflow ... Since you"re the codeowner are you able to merge it in the dev branch ore you've to wait for someone else (@balloob I suppose)?

@escoand
Copy link
Contributor

escoand commented Oct 26, 2019

As I understand it I'm now someone who's interested in and willing to develop this integration. Apparently I'll get notified if something happens at it, not more and not less.

@tulindo
Copy link
Contributor Author

tulindo commented Oct 31, 2019

@escoand this PR is still there waiting to be merged. Sure it's not up to you?
@MartinHjelmare can you explain us how the approval process works?

@escoand
Copy link
Contributor

escoand commented Oct 31, 2019

Yes, completely sure.

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Oct 31, 2019

A backend repo member should review and can also merge after the change is approved. Code owners are encouraged to review and approve (or disapprove) too. Some code owners are also members and can merge but these roles are not always overlapping.

Copy link
Contributor

@escoand escoand left a comment

Choose a reason for hiding this comment

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

Old and new keys are both not 100% matching, but the new ones a bit more.

@tulindo
Copy link
Contributor Author

tulindo commented Nov 14, 2019

@MartinHjelmare and @escoand any chance to get this simple PR merged?

@MartinHjelmare
Copy link
Member

Please update the breaking change paragraph with a brief description of what has changed and what the user needs to do to cope with the change.

@tulindo
Copy link
Contributor Author

tulindo commented Nov 15, 2019

Basically it was written in the description part. I made little modifications. Are they OK?

@MartinHjelmare
Copy link
Member

Thanks! I updated the language a bit.

Dev automation moved this from Needs review to Reviewer approved Nov 15, 2019
@MartinHjelmare MartinHjelmare merged commit b4ccc02 into home-assistant:dev Nov 15, 2019
Dev automation moved this from Reviewer approved to Done Nov 15, 2019
@tulindo tulindo deleted the SamsungNextPrevTrack branch November 15, 2019 11:45
@lock lock bot locked and limited conversation to collaborators Nov 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants