From 0287117d86f04c1305d1509463a292649132804d Mon Sep 17 00:00:00 2001 From: Tom J Nowell Date: Thu, 27 Jul 2023 13:31:31 +0100 Subject: [PATCH 1/3] turn off the backlight when setting the screen to blank --- examples/monitor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/monitor.py b/examples/monitor.py index 02f97f6..dbd1425 100644 --- a/examples/monitor.py +++ b/examples/monitor.py @@ -1135,9 +1135,10 @@ Low Light Value {:.2f} viewcontroller.update() if light_level_low and config.get_general().get("black_screen_when_light_low"): + display.set_backlight(GPIO.LOW) display.display(image_blank.convert("RGB")) - else: + display.set_backlight(GPIO.HIGH) viewcontroller.render() display.display(image.convert("RGB")) From 09d294600abefb2ee0d94631ec8b798d747bd033 Mon Sep 17 00:00:00 2001 From: Tom J Nowell Date: Mon, 7 Aug 2023 15:28:30 +0100 Subject: [PATCH 2/3] Update setup.cfg to use st7735>=0.0.5 --- library/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/setup.cfg b/library/setup.cfg index ef65b6d..b6d0e3e 100644 --- a/library/setup.cfg +++ b/library/setup.cfg @@ -30,7 +30,7 @@ python_requires = >= 3 packages = grow install_requires = ltr559 - st7735 + st7735>=0.0.5 pyyaml fonts font-roboto From 2b0c8aefd73f29fce3796cf095228be8a5f81726 Mon Sep 17 00:00:00 2001 From: Tom J Nowell Date: Mon, 7 Aug 2023 15:32:05 +0100 Subject: [PATCH 3/3] Update monitor.py to use the new sleep and wake functions also moved wake one line forward so the display isn't on but not updated while rendering --- examples/monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/monitor.py b/examples/monitor.py index dbd1425..9adb8dd 100644 --- a/examples/monitor.py +++ b/examples/monitor.py @@ -1135,11 +1135,11 @@ Low Light Value {:.2f} viewcontroller.update() if light_level_low and config.get_general().get("black_screen_when_light_low"): - display.set_backlight(GPIO.LOW) + display.sleep() display.display(image_blank.convert("RGB")) else: - display.set_backlight(GPIO.HIGH) viewcontroller.render() + display.wake() display.display(image.convert("RGB")) config.set_general(