Try all Samsung TV websocket ports#33001
Conversation
|
I don't mind testing this branch. I am using Hassio, how could I load up this on my end? |
|
@beloso Download the complete samsungtv directory and put it in the config directory under |
|
I can confirm that it's working. |
|
Well done @escoand! |
|
I've downloaded and tested the reviewed version of the component. Deleted the old integration and added again, it worked again. |
|
I guess I spoke too soon. With the revised version I am getting a loop of permission requests. |
|
@tulindo seems the config flow worked correctly but the token is getting lost or not valid any more. What do you think? |
|
I cleaned up some leftover entity and I was able to configure it again. Now it's working fine. |
|
@beloso Good for you, but hard to implement this workflow in the code. Could you be a bit more precisely? And maybe find a way to reproduce the problem and the solution? |
|
First of all, thanks for taking care of this fix in such a timely manner! |
| @@ -223,9 +224,13 @@ def try_connect(self): | |||
| return RESULT_SUCCESS | |||
| except WebSocketException: | |||
| LOGGER.debug("Working but unsupported config: %s", config) | |||
There was a problem hiding this comment.
Minor, but I would suggest dropping a more meaningful message here, something like:
LOGGER.debug("Websocket connection attempt failed with the following config: %s", config)
There was a problem hiding this comment.
Yes maybe it's a bit confusing but it describes exactly the problem: the connection is working but something went wrong, and if already the login fails it's apparently not like we support it.
|
@LeoCal With the referenced PR we now have the same situation in both issues. And yes, we need to handle this exception. But currently it looks like we have a problem with the token handling directly after config flow. After a restart it seems to work. |
Ok, thanks for the info! |
|
So, my issue is when I try to add the integration manually. I go to the list and select Samsung TV. I type in the IP address, I type in a name. It displays the request on the TV, I accept. Then the device does not show on HA. Asks me to restart, I do, and then it still on show, and it caused that loop of notifications. If I add it from the discovery component, it works as expected. |
|
@beloso Thanks for the precise description. Could you please also test the configuration within the yaml files? Can the other reproduce this as well? |
As mentioned in the issue I raised #33006, I also see a loop of notifications on my TV that I can stop only by killing home assistant instance. The config flow I followed is the one with the yaml file. |
|
Yesterday I gazed on the code and found no reason for the difference between the two flows. I don't have a websocket TV, so I'm unable to test it. |
|
I see no reason to merge this PR. It does fix the issue. I'll try to debug the other issue and keep you posted. |
|
@MartinHjelmare Ready for merge from my side. |
|
Agree, the second exception can be handled separately in the other issue I raised. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Great! Just a clean up.
|
Should this be tagged for a patch release? |
|
From my point of view yes. |
* Update bridge.py * add test * silence pylint * correct pylint * add some tests * Update test_media_player.py
* Update bridge.py * add test * silence pylint * correct pylint * add some tests * Update test_media_player.py
Breaking change
Proposed change
Currently the Samsung TV integration does only try to connect port 8001. This fix will also try 8002.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: