Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-init serial connection on SerialException #128

Closed
wants to merge 5 commits into from
Closed

Conversation

mickkn
Copy link

@mickkn mickkn commented Oct 18, 2024

Added re-init on SerialException.

This fix will re-init the TCP connection when using a Socket UART, and the connection was lost (mainly on Wi-Fi)

It will not make a new write after re-init, so the next reading is done after 3600s - maybe consider this - but I don't see a big issue since next write/reading will just be a higher value from the meter.

This might also have to be tested with normal UART hardware, to see if it mess something up :)

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.65%. Comparing base (0b30845) to head (304c2d0).

Files with missing lines Patch % Lines
...tom_components/kamstrup_403/pykamstrup/kamstrup.py 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
- Coverage   77.83%   77.65%   -0.19%     
==========================================
  Files           8        8              
  Lines         361      367       +6     
==========================================
+ Hits          281      285       +4     
- Misses         80       82       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mickkn mickkn closed this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant