Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
as some other people I had a problem with the EDL21 component of homeassistant (home-assistant/core#98409). After some time (random) no data are available anymore. The (info) log will show a lot of reconnection, but nothing happen. One way to fix it, is to restart the hole homeassistant.
I spent some time to find out the reason. One indicator was, that the led on my serial adapter was still active. So the serial port must be opened. Then I had created a custom component with a local copy of all libraries and add some debug messages to be able to follow the code.
Now I have simple removed one statement, which remove the reference to the transport before it is closed. Another idea was to close the connection before this line, if the exc parameter was a TimeoutError. But then the _disconnect function will never abort the transport and I used this way, now. Please feel free to comment and will try to adjust the path as fast as possible. Hope to get rid of this neasty problem ;-)
If the watchdog trigger connection_lost and the serial connection if already open, it was not possible to close/abort the connection.
Old:
New workflow could abort the transport and the new connection will work. Anyway connection_lost will be called twice:
The last one will do nothing more, because of the lock of _reconnect.