TheRealKillaruna / nano_pk

Home Assistant integration of Hargassner Nano-PK
Apache License 2.0
18 stars 17 forks source link

Make connection handling more robust #26

Open skrue opened 4 months ago

skrue commented 4 months ago

This solved #25 for me. Seems that writer could not successfully be closed after a ConnectionResetError. Now an exception is thrown and self._reader and self._writer are set to None. This way the next attempt to open the connection succeeds.

anderl78 commented 3 months ago

Ok, since 3 days no connection error. Perfekt. Thank you!

skrue commented 3 months ago

@anderl78 Good to know, thank you for testing! I am not too experienced with Python programming so this was a bit of trial-and-error and I'm not sure if it is actually a valid approach, but it did improve the situation so it can't be completely wrong. @TheRealKillaruna maybe you want to merge this PR now?

anderl78 commented 1 week ago

@skrue: would be great if you could look here: https://github.com/TheRealKillaruna/nano_pk/issues/38#issue-2543217981