aequitas/python-rflink

TCP based connections dies without HomeAssistant/protocol.py

cpainchaud opened this issue · 3 comments

Hi!

So my understanding is that HASSIO integration is using protocol.py under the hood. There is something which drives me crazy : HASSIO never noticies when RFlink reboots, it thinks its still open while the connection has dies on the other side. To my surprise TCP Keepalive is not enabled at all, even after 6 hours it still thinks it's online.

I was thinking that in ProtocolBase::connection_made we could get the socket and add KEEPALIVE options (with configurable timeout + interval values).

It sounds doable to me but I am completely lost when it comes know how to test that change on HASSIO, they dont even let you access the scripts sources or I would have sent you a patch myself already. It looks like it's about 10 lines of code.

thank you for reading !

The rflink component for home assistant uses this library underneath. You could try to just run this library without home assistant to see if the problem persists. Then you can test/solve it here and the solution would probably carry over to home assistant. I'll gladly review and merge a PR if you can provide one.

I'm not familiar with the hassio development cycle as well so I can't assist there. Best would be to contact home assistant developers or community on their chat of forum for support on that.

thank for your prompt reply and good suggestion, here is the PR ! :)

Let's close it now ! #58