Skip to content

Commit 6c0a703

Browse files
authored
Don't render on each frame when the display is blank
What's the point in updating `image` if we're just going to display the blank one anyway? This should save a tiny bit of CPU/power
1 parent b1c4ed2 commit 6c0a703

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,12 +1133,12 @@ def handle_button(pin):
11331133
alarm.update(light_level_low)
11341134

11351135
viewcontroller.update()
1136-
viewcontroller.render()
11371136

11381137
if light_level_low and config.get_general().get("black_screen_when_light_low"):
11391138
display.display(image_blank.convert("RGB"))
11401139

11411140
else:
1141+
viewcontroller.render()
11421142
display.display(image.convert("RGB"))
11431143

11441144
config.set_general(

0 commit comments

Comments
 (0)