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

Update / fix MeterValues format #301

Merged
merged 2 commits into from
May 18, 2024
Merged

Update / fix MeterValues format #301

merged 2 commits into from
May 18, 2024

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
5 checks passed
@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