Skip to content

Commit

Permalink
fix in boilstep -> calculation for next hop timer
Browse files Browse the repository at this point in the history
  • Loading branch information
avollkopf committed Jan 5, 2025
1 parent 06ce425 commit 92854a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cbpi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "4.5.0.a3"
__version__ = "4.5.0.a4"
__codename__ = "Cross Country"

13 changes: 8 additions & 5 deletions cbpi/extension/mashstep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,11 @@ async def next_hop_timer(self):
hop = int(self.props.get("Hop_%s" % x, None)) * 60
except:
hop = None
if hop is not None:
if hop is not None and self.remaining_seconds is not None:
hop_left = self.remaining_seconds - hop
if hop_left > 0:
hop_timers.append(hop_left)

if len(hop_timers) != 0:
if hop_timers:
next_hop_timer = time.strftime("%H:%M:%S", time.gmtime(min(hop_timers)))
else:
next_hop_timer = None
Expand Down Expand Up @@ -476,8 +475,12 @@ async def run(self):
estimated_completion_time = datetime.fromtimestamp(time.time()+ (int(self.props.get("Timer", 0)))*60)
self.cbpi.notify(self.name, 'Timer started. Estimated completion: {}'.format(estimated_completion_time.strftime("%H:%M")), NotificationType.INFO)
else:
nexthoptimer=await self.next_hop_timer()
self.summary2="Add Hop in: %s" % nexthoptimer if nexthoptimer is not None else None
if self.timer.is_running:
try:
nexthoptimer = await self.next_hop_timer()
self.summary2="Add Hop in: %s" % nexthoptimer if nexthoptimer is not None else ""
except:
self.summary2=""
for x in range(1, 6):
await self.check_hop_timer(x, self.props.get("Hop_%s" % x, None), self.props.get("Hop_%s_text" % x, None))

Expand Down

0 comments on commit 92854a1

Please sign in to comment.