Skip to content

Conversation

@PolarGoose
Copy link
Collaborator

@PolarGoose PolarGoose marked this pull request as ready for review December 2, 2025 14:23
Copilot AI review requested due to automatic review settings December 2, 2025 14:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for parsing gas delivery measurements in GigaJoules (GJ), required for Eneco's district heating smart meters in the Netherlands. The PR also includes code refactoring to simplify numeric parsing logic and freezes the cmake_template dependency version for reproducibility.

Key changes:

  • Adds new gas_delivered_gj field with GJ/MJ units sharing the same OBIS ID as gas_delivered
  • Introduces NumParser::parse_float_or_int helper method to reduce code duplication
  • Freezes cmake_template version to a specific commit hash

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/dsmr_parser/fields.h Adds gas_delivered_gj field definition and refactors FixedField/AveragedFixedField to use new parse_float_or_int helper
src/dsmr_parser/parser.h Introduces parse_float_or_int method to consolidate float/integer parsing with unit fallback logic
tests/parser_test.cpp Adds test case for gas_delivered_gj field and updates unknown_error flag in two existing tests
CMakeLists.txt Changes cmake_template from tracking main branch to specific commit hash for build reproducibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  * Add gas_delivered_gj
* Add `NumParser::parse_float_or_int` method to simplify existing code
* `CMakeLists.txt`: freeze `cmake_template` version.
@PolarGoose PolarGoose force-pushed the gas_delivered_field_can_have_GJ_units_instead_of_m3 branch from f3dc0df to b851744 Compare December 2, 2025 16:37
@PolarGoose PolarGoose merged commit 0f95a40 into main Dec 2, 2025
2 checks passed
@PolarGoose PolarGoose deleted the gas_delivered_field_can_have_GJ_units_instead_of_m3 branch December 2, 2025 16:53
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.

gas_delivered field can have GJ units instead of m3.

2 participants