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 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

This comment has been minimized.

Copy link

probot-home-assistant bot commented Oct 25, 2019

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

escoand commented Oct 26, 2019

LGTM. Would you like to take ownership too?

@tulindo

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

escoand commented Oct 31, 2019

Yes, completely sure.

@MartinHjelmare

This comment has been minimized.

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 left a comment

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

@tulindo

This comment has been minimized.

Copy link
Contributor Author

tulindo commented Nov 14, 2019

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

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 14, 2019

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 15, 2019

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
12 checks passed
12 checks passed
CI Build #20191025.58 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 100% of diff hit (target 94.34%)
Details
codecov/project 94.34% (target 90%)
Details
docs-missing Documentation ok.
Dev automation moved this from Reviewer approved to Done Nov 15, 2019
pull bot added a commit to KoHcoJlb/home-assistant that referenced this pull request Nov 15, 2019
@tulindo tulindo deleted the tulindo:SamsungNextPrevTrack branch Nov 15, 2019
KJonline added a commit to KJonline/home-assistant that referenced this pull request Nov 16, 2019
* dev: (200 commits)
  Truncate sensor state values (home-assistant#28788)
  Fix broken postnl sensor (home-assistant#28794)
  Move imports in braviatv component (home-assistant#27855)
  Add ombi password authentication option (home-assistant#28742)
  Lint exclusions (home-assistant#28655)
  Upgrade pylint, tweak config (home-assistant#28798)
  Bump pyHik library to 0.2.5 for id, tamper fixes (home-assistant#28807)
  Upgrade sqlalchemy to 1.3.11 (home-assistant#28721)
  Fix Repetier integration entity indexing (home-assistant#28766)
  Updated frontend to 20191115.0 (home-assistant#28797)
  [ci skip] Translation update
  Add support for Hisense AEH-W4A1 wifi module (AC remote control) (home-assistant#28641)
  Fix changing venstar operation_mode (home-assistant#28754)
  Fix Swisscom empty response received (home-assistant#28782)
  Fix HomematicIP Cloud Alarm Control Panel support for basic mode (home-assistant#28778)
  Change keys for Samsung TV next and prev track command (home-assistant#28213)
  Change unique id for SAJ sensor based on device SN (home-assistant#28663)
  bump home mitemp_bt to 0.0.3. It has an important bugfix for reading … (home-assistant#28765)
  Convert Tesla to Async (home-assistant#28748)
  Bump pytest to 5.2.3 (home-assistant#28785)
  ...

# Conflicts:
#	homeassistant/generated/config_flows.py
#	script/gen_requirements_all.py
thomasgermain added a commit to thomasgermain/home-assistant that referenced this pull request Nov 16, 2019
@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
4 participants
You can’t perform that action at this time.