From 9d629b7a33b7970ee230ca86470f963c16f14147 Mon Sep 17 00:00:00 2001 From: Mike Bishop Date: Tue, 8 Nov 2022 18:21:22 +0000 Subject: [PATCH] Dangling getSlaveTWCs() reference --- lib/TWCManager/Control/HTTPControl.py | 2 +- lib/TWCManager/EVSEController/Gen2TWCs.py | 2 +- lib/TWCManager/EVSEInstance/Gen2TWC.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/TWCManager/Control/HTTPControl.py b/lib/TWCManager/Control/HTTPControl.py index a5007d12..55858833 100644 --- a/lib/TWCManager/Control/HTTPControl.py +++ b/lib/TWCManager/Control/HTTPControl.py @@ -375,7 +375,7 @@ def do_API_GET(self): } avgCurrent = 0 - for slave in master.getSlaveTWCs(): + for slave in master.getAllEVSEs(): avgCurrent += slave.historyAvgAmps data[endTime.isoformat(timespec="seconds")] = master.convertAmpsToWatts( avgCurrent diff --git a/lib/TWCManager/EVSEController/Gen2TWCs.py b/lib/TWCManager/EVSEController/Gen2TWCs.py index cf900b34..f9b8d9fe 100644 --- a/lib/TWCManager/EVSEController/Gen2TWCs.py +++ b/lib/TWCManager/EVSEController/Gen2TWCs.py @@ -161,7 +161,7 @@ def parseMessages(self, master): "Stop sending them heartbeat messages." % (slaveTWC.TWCID[0], slaveTWC.TWCID[1]) ) - master.deleteSlaveTWC(slaveTWC.TWCID) + self.deleteTWC(slaveTWC.TWCID) else: slaveTWC.send_master_heartbeat() diff --git a/lib/TWCManager/EVSEInstance/Gen2TWC.py b/lib/TWCManager/EVSEInstance/Gen2TWC.py index faac4238..23d7b8e6 100644 --- a/lib/TWCManager/EVSEInstance/Gen2TWC.py +++ b/lib/TWCManager/EVSEInstance/Gen2TWC.py @@ -394,7 +394,7 @@ def send_slave_heartbeat(self, masterID): self.send( bytearray(b"\xFD\xE0") - + self.self.controller.getFakeTWCID() + + self.controller.getFakeTWCID() + bytearray(masterID) + bytearray(self.master.slaveHeartbeatData) ) @@ -737,7 +737,7 @@ def receive_slave_heartbeat(self, heartbeatData): if numCarsCharging > 0: desiredAmpsOffered -= sum( slaveTWC.reportedAmpsActual - for slaveTWC in self.controller.getSlaveTWCs() + for slaveTWC in self.master.getAllEVSEs() if slaveTWC.TWCID != self.TWCID ) flex = self.master.getAllowedFlex() / numCarsCharging