Extend list of patterns so that all dumps doesn't need custom patterns configured#8
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the built-in AXDR pattern set loaded by DlmsParser::load_default_patterns() so integration tests for various meter dumps no longer need per-test custom pattern registration, and updates expected fixtures to reflect the additional/default matches.
Changes:
- Added multiple additional default AXDR patterns (OBIS/value variants, datetime variants, etc.) to
DlmsParser::load_default_patterns(). - Simplified
tests/test_meter_dumps.cppby removing per-testregister_pattern(...)setup lambdas where defaults now cover the structures. - Updated several
tests/expected/*.hfixtures (counts and expected values/strings) to match new default pattern behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_meter_dumps.cpp | Removes custom per-dump pattern registration now covered by defaults. |
| tests/expected/raw_energomera.h | Updates expected count and adds one newly matched float entry. |
| tests/expected/mbus_netz_noe_p1.h | Updates expected count and adds a DateTime string expectation. |
| tests/expected/hdlc_lgz_e450_2.h | Updates expected count and adds a DateTime string expectation. |
| tests/expected/hdlc_kaifa_ma304h3e.h | Reformats fixture and changes placeholder expectations to a real expected string/count. |
| src/dlms_parser/dlms_parser.cpp | Extends the library’s default AXDR pattern registrations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
40e4ab9 to
c9ec694
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c9ec694 to
ba6bfc8
Compare
Tomer27cz
left a comment
There was a problem hiding this comment.
Sure. The usability gain outweighs the microscopic performance loss.
|
Do you know why we need |
|
|
|
Don't forget to update the idf_component version |
I added all custom patterns that we encountered to the list of default patterns. Now the user has less need to specify custom patterns. Also, it should make usage from EspHome much easier for users.
Also, by doing that, I found that there were some values we missed in the dumps we have.