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

StatusNotification error severity mechanism & report resolved errors #331

Merged
merged 6 commits into from
Jul 23, 2024

Conversation

matth-x
Copy link
Owner

@matth-x matth-x commented Jun 27, 2024

This adds the error severity field to the MO error reporting mechanism. The severity can be used to avoid that less important errors are being reported to the server while still being in a highly severe error condition. If the most severe error is resolved, then MO reports the next most severe error. This behavior is useful for some backend systems.

See this example for changing the severity:

addErrorDataInput([] () -> ErrorData {
    if (/* error condition */) {
        ErrorData error = "OtherError";
        error.severity = 2; //increase severity to `2` (default is `1`)
        return error;
    }
    return nullptr;
});

The new build option MO_REPORT_NOERROR=1 applies to errors which don't lead to the Faulted status, i.e. where error.isFaulted == false (for example, the charger reports the WeakSignal error while remaining Available). If all of these errors are resolved, then MO sends a further StatusNotification message with the error code NoError.

@matth-x matth-x merged commit fb6a765 into main Jul 23, 2024
5 checks passed
@matth-x matth-x deleted the feature/report-no-error branch July 23, 2024 16:21
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