From f1c4b70efd71e9caa12bbe2543dcaae55d080f17 Mon Sep 17 00:00:00 2001 From: oldnapalm <38410858+oldnapalm@users.noreply.github.com> Date: Tue, 14 Jul 2020 17:50:02 -0300 Subject: [PATCH] Update bot.py --- bot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 122f6ab..af07de2 100644 --- a/bot.py +++ b/bot.py @@ -65,11 +65,12 @@ def disable_event(): print("Main wait loop") while True: try: - power = w.get() t = int(time.time()) - if power and t >= last + 1: - power_meter.update(power) - last = t + if t >= last + 1: + power = w.get() + if power: + power_meter.update(power) + last = t master.update_idletasks() master.update() except (KeyboardInterrupt, SystemExit):