Skip to content

Update / fix MeterValues format#301

Merged
matth-x merged 2 commits intomainfrom
fix/metering-inputs
May 18, 2024
Merged

Update / fix MeterValues format#301
matth-x merged 2 commits intomainfrom
fix/metering-inputs

Conversation

@matth-x
Copy link
Owner

@matth-x matth-x commented May 18, 2024

Change the data type of the default EnergyMeterInput to int.

It may be necessary to patch the data format in the host system integration. For example, the previous usage

setEnergyMeterInput([] () -> float {
    return /* energy_register */;
});

would become

setEnergyMeterInput([] () -> int {
    return /* (int) energy_register */;
});

Furthermore, this PR fixes the float format in MeterValues which contained white spaces in some scenarios (e.g. " 0.0"). If the float format doesn't suit the application, the firmware can override it by setting the build flag MO_SAMPLEDVALUE_FLOAT_FORMAT (default: "%.2f")

@matth-x matth-x marked this pull request as ready for review May 18, 2024 17:00
@matth-x matth-x merged commit 94eb0eb into main May 18, 2024
@matth-x matth-x deleted the fix/metering-inputs branch May 18, 2024 17:01
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