Skip to content

Commit

Permalink
fix: ensure that updates_per_interval cannot be reduced to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Mulliken committed Sep 28, 2021
1 parent ed7eb5a commit 4e6d3eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[metadata]
# replace with your username:
name = wyzeapy
version = 0.5.0b1
version = 0.5.0b2
author = Mulliken LLC
author_email = joshua@mulliken.net
description = Python client for private Wyze API
Expand Down
3 changes: 2 additions & 1 deletion src/wyzeapy/services/update_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def tick_tock(self):

def delay(self):
# This should be called to reduce the number of updates per interval so that new devices can be added into the queue fairly
self.updates_per_interval -= 1
if self.updates_per_interval > 1:
self.updates_per_interval -= 1

class UpdateManager:
# Holds all the logic for when to update the devices
Expand Down

0 comments on commit 4e6d3eb

Please sign in to comment.