Skip to content

Commit

Permalink
fix type; add .value to total_power
Browse files Browse the repository at this point in the history
Signed-off-by: Cornelius Claussen <[email protected]>
  • Loading branch information
corneliusclaussen committed Dec 22, 2023
1 parent cca36db commit 3802273
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/EnergyManager/BrokerFastCharging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ bool BrokerFastCharging::buy_ampere(const types::energy::ScheduleReqEntry& _offe

// we have an additional watt limit
if (total_power.has_value()) {
if (total_power > 0) {
if (total_power.value() > 0) {
// is the watt limit high enough?
if (total_power.value() >= max_current.value() * max_phases * local_market.nominal_ac_voltage()) {
// yes, buy both ampere and watt
Expand All @@ -216,7 +216,7 @@ bool BrokerFastCharging::buy_ampere(const types::energy::ScheduleReqEntry& _offe
return true;
}
} else {
// Don't buy anything it the total power limit is 0
// Don't buy anything if the total power limit is 0
return false;
}
} else {
Expand Down

0 comments on commit 3802273

Please sign in to comment.