sermayoral / ha-samsungtv-encrypted

Samsung TV Encrypted Models (H & J Series) custom component for Home Assistant
Apache License 2.0
38 stars 24 forks source link

User supplied port in connection urls #61

Closed EPMatt closed 4 years ago

EPMatt commented 4 years ago

Hi @sermayoral, while trying to connect a J series TV (see issue #62) I took a deeper look in the PySmartCrypto code and found that the user supplied port is not being used when pairing with the device:

step4_url = 'http://' + self._host + ':8000/socket.io/1/?t=' + str(millis)
...
websocket_url = 'ws://' + self._host + ':8000/socket.io/1/websocket/' + websocket_response.text.split(':')[0]

Instead the hardcoded value 8000 is used.

This PR implement the insertion of user supplied port into the urls to possibly solve many connection issues experienced by different users (it should partially address #21 ).

sermayoral commented 4 years ago

@EPMatt you are right. Thanks!!