From 2e75580fea1b7502764c87ae266a2cb9f81ea573 Mon Sep 17 00:00:00 2001 From: johannes Date: Tue, 20 Jun 2023 22:44:49 +0200 Subject: [PATCH] Sending real charger parameters and values to hardwareInterface --- fsmPev.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fsmPev.py b/fsmPev.py index 95b3558..61acb26 100644 --- a/fsmPev.py +++ b/fsmPev.py @@ -426,7 +426,9 @@ class fsmPev(): self.publishStatus("ChargeParams discovered") self.addToTrace("Checkpoint550: ChargeParams are discovered. Will change to state C.") #Report charger paramters - self.hardwareInterface.setChargerParameters(500, 50) #TODO: send real parameters + maxI = combineValueAndMultiplier(y["EVSEMaximumCurrentLimit.Value"], y["EVSEMaximumCurrentLimit.Multiplier"]) + maxV = combineValueAndMultiplier(y["EVSEMaximumVoltageLimit.Value"], y["EVSEMaximumVoltageLimit.Multiplier"]) + self.hardwareInterface.setChargerParameters(maxV, maxI) # pull the CP line to state C here: self.hardwareInterface.setStateC() self.addToTrace("Checkpoint555: Locking the connector.") @@ -652,10 +654,13 @@ class fsmPev(): strResponseCode = y["ResponseCode"] strEVSEPresentVoltageValue = y["EVSEPresentVoltage.Value"] strEVSEPresentVoltageMultiplier = y["EVSEPresentVoltage.Multiplier"] + strEVSEPresentCurrentValue = y["EVSEPresentCurrent.Value"] + strEVSEPresentCurrentMultiplier = y["EVSEPresentCurrent.Multiplier"] u = combineValueAndMultiplier(strEVSEPresentVoltageValue, strEVSEPresentVoltageMultiplier) + i = combineValueAndMultiplier(strEVSEPresentCurrentValue, strEVSEPresentCurrentMultiplier) self.callbackShowStatus(format(u,".1f"), "EVSEPresentVoltage") strEVSEStatusCode = y["DC_EVSEStatus.EVSEStatusCode"] - self.hardwareInterface.setChargerVoltageAndCurrent(u, EVTargetCurrent) #TODO: report real current! + self.hardwareInterface.setChargerVoltageAndCurrent(u, i) except: self.addToTrace("ERROR: Could not decode the PreChargeResponse") if (strResponseCode!="OK"):