Skip to content

Commit

Permalink
Logs clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Seba committed Apr 23, 2019
1 parent c788899 commit 5f705f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions samsung_2878.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, hass_config, logger):
self._connection_init_template = None
self._cfg = connection_config(None, None, None, None, None)
self._device_status = {}
self._socket_timeout = 2 # in seconds
self._socket_timeout = 1 # in seconds
self.update_configuration_from_hass(hass_config)

def update_configuration_from_hass(self, hass_config):
Expand Down Expand Up @@ -114,11 +114,12 @@ def read_line_from_socket(self, sslSocket):
import select
reply = None
ready = select.select([sslSocket], [], [], self._socket_timeout)
self.logger.info("Reading data from socket...")
if ready and ready[0]:
reply = sslSocket.recv(4096).decode("utf-8")
self.logger.info("Response: {}".format(reply))
else:
self.logger.warning("Socket timed out")
self.logger.info("Timed out, no data to read")
return reply

def handle_response_invalidate_account(self, sslSocket, response):
Expand Down

0 comments on commit 5f705f0

Please sign in to comment.