Skip to content

Commit

Permalink
Keep timeLastAmpsOfferedChanged check
Browse files Browse the repository at this point in the history
MikeBishop committed Aug 2, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1115cc4 commit e6c2ad9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/TWCManager/TWCSlave.py
Original file line number Diff line number Diff line change
@@ -700,7 +700,9 @@ def receive_slave_heartbeat(self, heartbeatData):

dampenChanges = (
True
if now - self.timeLastAmpsDesiredFlipped < self.startStopDelay
if now
- min(self.timeLastAmpsDesiredFlipped, self.timeLastAmpsOfferedChanged)
< self.startStopDelay
else False
)

@@ -936,7 +938,7 @@ def receive_slave_heartbeat(self, heartbeatData):
):
self.lastAmpsDesired = desiredAmpsOffered
self.timeLastAmpsDesiredFlipped = now
logger.info("lastAmpsDesired flipped - now " + str(desiredAmpsOffered))
logger.debug("lastAmpsDesired flipped - now " + str(desiredAmpsOffered))

# Keep charger on or off if dampening changes. See reasoning above where
# I don't turn the charger off till it's been on for a bit.

0 comments on commit e6c2ad9

Please sign in to comment.