From 258aab08a8787d2c93b874e9df4ac2538f7a2f18 Mon Sep 17 00:00:00 2001 From: Steveis Date: Wed, 29 Aug 2018 08:07:51 +0100 Subject: [PATCH] add sleep.wfi() Change ```time.sleep(0.01)``` to ```sleep.wfi()``` to save battery power when sleep.wfi() is fixed. Ironically, this change will increase battery load until sleep.wfi() is implemented properly. But it is in line with the instructions here https://github.com/emfcamp/Mk4-Apps/blob/69c7cd39b5ccdf7f39f1010c7203803c620c8c92/lib/homescreen.py#L9 --- sponsors/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sponsors/main.py b/sponsors/main.py index 082f2e9..5f768e2 100644 --- a/sponsors/main.py +++ b/sponsors/main.py @@ -2,11 +2,11 @@ ___name___ = "Sponsors" ___license___ = "MIT" -___dependencies___ = ["wifi", "http", "ugfx_helper"] +___dependencies___ = ["wifi", "http", "ugfx_helper", "sleep"] ___categories___ = ["EMF"] ___bootstrapped___ = True -import ugfx_helper, os, wifi, ugfx, http, time +import ugfx_helper, os, wifi, ugfx, http, time, sleep from tilda import Buttons ugfx_helper.init() @@ -21,6 +21,6 @@ except: ugfx.text(5, 5, "Couldn't download sponsors", ugfx.BLACK) while (not Buttons.is_pressed(Buttons.BTN_A)) and (not Buttons.is_pressed(Buttons.BTN_B)) and (not Buttons.is_pressed(Buttons.BTN_Menu)): - time.sleep(0.01) + sleep.wfi() ugfx.clear()