sermayoral / ha-samsungtv-encrypted

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

error power off tv #37

Closed brunokelo closed 3 years ago

brunokelo commented 4 years ago

when I click to turn off the tv the following error appears,

Has anyone ever experienced this?

thank you.

Logger: homeassistant.components.websocket_api.http.connection.140102350376592 Source: custom_components/samsungtv_encrypted/PySmartCrypto/command_encryption.py:24 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 21:06:20 (2 occurrences) Last logged: 21:06:25

Odd-length string Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service connection.context(msg), File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1288, in _execute_service await handler.func(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service self._platforms.values(), func, call, required_features File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/media_player/init.py", line 530, in async_turn_off await self.hass.async_add_job(self.turn_off) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/samsungtv_encrypted/media_player.py", line 401, in turn_off self.get_remote().close() File "/config/custom_components/samsungtv_encrypted/media_player.py", line 225, in get_remote self._remote = self._remote_class(self._host, self._port, self._token, self._sessionid) File "/config/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 153, in init self._aesLib = AESCipher(self._token.upper(), self._sessionid) File "/config/custom_components/samsungtv_encrypted/PySmartCrypto/command_encryption.py", line 24, in init self.key = binascii.unhexlify(key) binascii.Error: Odd-length string

brunokelo commented 4 years ago

binascii.Error: Odd-length string

sermayoral commented 4 years ago

What model is your TV?