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

Fix debug output of EV max voltage #905

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

corneliusclaussen
Copy link
Contributor

Describe your changes

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

Signed-off-by: Cornelius Claussen <[email protected]>
Copy link
Contributor

@SebaLukas SebaLukas left a comment

Choose a reason for hiding this comment

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

👍

@hikinggrass hikinggrass added the include-in-release Tag that this PR should be included in the current merge window for the upcoming release if possible label Oct 11, 2024
Comment on lines 1395 to 1401
float ev_max_voltage = 500.;

if (ev_info.maximum_voltage_limit.has_value()) {
EVLOG_info << "EV reports " << ev_info.maximum_voltage_limit.has_value() << " V as maximum voltage";
EVLOG_info << "EV reports " << ev_info.maximum_voltage_limit.value() << " V as maximum voltage";
ev_max_voltage = ev_info.maximum_voltage_limit.value();
} else {
EVLOG_error << "CableCheck: Did not receive EV maximum voltage, falling back to 500V";
Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably add a constant for the 500V, like DEFAULT_MAXIMUM_VOLTAGE. Otherwise, if this gets changed, chances are likely that the EVLOG_error still logs 500V. One may also use
const auto ev_max_voltage = ev_info.maximum_voltage_limit.value_or(DEFAULT_MAXIMUM_VOLTAGE) then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include-in-release Tag that this PR should be included in the current merge window for the upcoming release if possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants