Update regex to parse logbook for FCR-D #43
Merged
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.
There appears to have been some changes in the logbook over time and this regex should improve fetching the data.
The existing regex supports the old format
[ FCR-D ACTIVATED ] example@example.com --12345-- 97,7/0,5/99,3 % (7 kW) 2024-07-07 00:08:19 API-BACKENDIn recent logs the power is defined as
(7,0/7,0 kW). There also appears to be an intermediate definition of(7/7 kW)but this regex does not handle those cases.This new regex also handles both the failed activation logs as well as deactivation in the format of:
[ FCR-D FAIL ACTIVATION ] 54x example@example.com --12345-- 85,9/0,6/97,0 % (10,0/10,0 kW) 2025-04-24 00:02:57 API-BACKEND[ FCR-D DEACTIVATE ] UP 49,83 Hz 0,0 % (6 kW) 2025-01-31 00:16:00 API-BACKENDOn some occasions the power is identified as
INFbut that is not handled by this regex.Otherwise the changes should be backwards compatible with the note that group 8 changes from
7to7,0/7,0.