python-luxtronik
python-luxtronik copied to clipboard
socket.recv() waits infinite when the connection is lost
If the connection is already established, a new call to read() will never finished in case the connection to the heat pump is lost inbetween.
It seems to resume if the heat pump is available again.
Is this a bug or a feature?
We could set _socket.setdefaulttimeout() to a sensible value, e.g., 5 seconds.
What shall we do when the timeout occurs? Raise an error? Try to reconnect?
Normally I would close the socket and return the error status using the return parameter. The user then has to handle the error.
But that's almost like an "API change".