Skip to content

Commit b2b8741

Browse files
committed
opt out charging limit if neg. (matth-x/MicroOcpp#310)
1 parent d15234e commit b2b8741

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/evse.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,13 @@ void Evse::setup() {
120120
});
121121

122122
setSmartChargingPowerOutput([this] (float limit) {
123-
MO_DBG_DEBUG("set limit: %f", limit);
124-
this->limit_power = limit;
123+
if (limit >= 0.f) {
124+
MO_DBG_DEBUG("set limit: %f", limit);
125+
this->limit_power = limit;
126+
} else {
127+
// negative value means no limit defined
128+
this->limit_power = SIMULATE_POWER_CONST;
129+
}
125130
}, connectorId);
126131
}
127132

0 commit comments

Comments
 (0)