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

Limit to ev_max_current/voltage if target is higher #888

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions modules/EvseManager/EvseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,18 @@ void EvseManager::ready() {
if (config.hack_skoda_enyaq and (v.dc_ev_target_voltage < 300 or v.dc_ev_target_current < 0))
return;

// Limit voltage/current for broken EV implementations
const auto ev = get_ev_info();
if (ev.maximum_current_limit.has_value() and
v.dc_ev_target_current > ev.maximum_current_limit.value()) {
v.dc_ev_target_current = ev.maximum_current_limit.value();
}

if (ev.maximum_voltage_limit.has_value() and
v.dc_ev_target_voltage > ev.maximum_voltage_limit.value()) {
v.dc_ev_target_voltage = ev.maximum_voltage_limit.value();
}

if (v.dc_ev_target_voltage not_eq latest_target_voltage or
v.dc_ev_target_current not_eq latest_target_current) {
latest_target_voltage = v.dc_ev_target_voltage;
Expand Down
Loading