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

Support parsing nibepi style logs #136

Merged
merged 2 commits into from
Dec 10, 2023
Merged

Support parsing nibepi style logs #136

merged 2 commits into from
Dec 10, 2023

Conversation

elupus
Copy link
Collaborator

@elupus elupus commented Dec 9, 2023

Allow cli to parse nibepi style logs. They look like these:

Serial: [92,0,2,85,2,8,118,43]
Err adr: [92,0,2,85,2,8,118,43]
Serial: [92,65,201,115,0,251,6,92,65,201,237,0,101]
Err adr: [92,65,201,115,0,251,6,92,65,201,237,0,101]
Serial: [6]
Serial: [92,65,201,183,0,63]
Err adr: [92,65,201,183,0,63]
Serial: [6]
Serial: [92,65,201,242,0,122]
Err adr: [92,65,201,242,0,122]

It's only the serial values that are of interest.

Copy link

codecov bot commented Dec 9, 2023

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (674c3c6) 58.26% compared to head (e2c6222) 57.60%.
Report is 2 commits behind head on master.

Files Patch % Lines
nibe/console_scripts/cli.py 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
- Coverage   58.26%   57.60%   -0.67%     
==========================================
  Files          14       14              
  Lines        1198     1210      +12     
==========================================
- Hits          698      697       -1     
- Misses        500      513      +13     

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

@yozik04 yozik04 merged commit b8cbdd9 into yozik04:master Dec 10, 2023
@@ -203,15 +204,34 @@
yield from bytes.fromhex(line)


RE_NIBEPI_LOG = re.compile(r"Serial: \[((?:[0-9]+,?)+)\]")

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings starting with 'Serial: \[' and containing many repetitions of '0'.
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.

2 participants