From 18687e52785cd67a0a7881384f58f0060c395fd6 Mon Sep 17 00:00:00 2001 From: "regicidal.plutophage" <36969337+regicidalplutophage@users.noreply.github.com> Date: Wed, 1 Mar 2023 05:50:01 +0300 Subject: [PATCH] Fix power.py module The last update to this module used new at the time ```check_deadline``` function wrong, I seem to have fixed this. --- kmk/modules/power.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kmk/modules/power.py b/kmk/modules/power.py index aa72eb1..81385d9 100644 --- a/kmk/modules/power.py +++ b/kmk/modules/power.py @@ -103,9 +103,9 @@ class Power(Module): ''' Sleeps longer and longer to save power the more time in between updates. ''' - if check_deadline(ticks_ms(), self._powersave_start) <= 60000: + if check_deadline(ticks_ms(), self._powersave_start, 60000): sleep(8 / 1000) - elif check_deadline(ticks_ms(), self._powersave_start) >= 240000: + elif check_deadline(ticks_ms(), self._powersave_start, 240000) is False: sleep(180 / 1000) return @@ -123,7 +123,7 @@ class Power(Module): return def usb_rescan_timer(self): - return bool(check_deadline(ticks_ms(), self._usb_last_scan) > 5000) + return bool(check_deadline(ticks_ms(), self._usb_last_scan, 5000) == False) def usb_time_reset(self): self._usb_last_scan = ticks_ms()