Skip to content

Commit f9a2938

Browse files
committed
Add exception for socket timeout
1 parent 5bedf94 commit f9a2938

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

custom_components/luxtronik/lux_helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ def _read_write(self, write=False):
240240
self._socket.connect((self._host, self._port))
241241
else:
242242
raise err
243+
except socket.timeout:
244+
LOGGER.error("Connection to %s:%s timed out after %ss", self._host, self._port, self._socket_timeout)
245+
self._disconnect()
246+
return
243247
self._socket.settimeout(self._socket_timeout)
244248
LOGGER.info(
245249
"Connected to Luxtronik heatpump %s:%s with timeout %ss",

0 commit comments

Comments
 (0)