snaptec / openWB

openWB - die modulare Wallbox
https://openwb.de
GNU General Public License v3.0
341 stars 205 forks source link

fix reconnection delay #2822

Closed benderl closed 4 months ago

benderl commented 4 months ago

Seems like SE needs some time before a new connection can be established. Tested with 2.0s down to 1.0s and 1.2s might be okay and stable. This PR only considers read_legacy().

This is only a quick and dirty fix. Only one connection should be used also in legacy mode.

yankee42 commented 4 months ago

Bis jetzt dürfte der kein reconnect gemacht haben, weil das erst nach dem with self.client: kommen würde, was bisher nicht da war. Sicher, dass das die Ursache ist? Ansonsten könnte es ggf. übersichtlicher sein, den delay hinter dem with self.client: unterzubringen, weil dann der Zusammenhang offensichtlicher ist...

benderl commented 4 months ago

Auf welchen Teil beziehst Du Dich?

yankee42 commented 4 months ago

Auf welchen Teil beziehst Du Dich?

Hierrauf:

Seems like SE needs some time before a new connection can be established.

If the reason for inserting the delays is the need for a delay between closing and opening a connection, then this is inconsistent with the absence of closing the connection. Or did I miss a place where the connection is closed?