Skip to content

Commit

Permalink
Dangling getSlaveTWCs() reference
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeBishop committed Nov 8, 2022
1 parent caaab49 commit 9d629b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/TWCManager/Control/HTTPControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/TWCManager/EVSEController/Gen2TWCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions lib/TWCManager/EVSEInstance/Gen2TWC.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d629b7

Please sign in to comment.