Skip to content

Commit a20d71b

Browse files
committed
Turn the screen off when program is stopped cleanly
1 parent ec1ca11 commit a20d71b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

library/display.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def initialize_display(self):
6666
# Send initialization commands
6767
self.lcd.InitializeComm()
6868

69+
# Turn screen on in case it was turned off previously
70+
self.lcd.ScreenOn()
71+
6972
# Set brightness
7073
self.lcd.SetBrightness(CONFIG_DATA["display"]["BRIGHTNESS"])
7174

main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434

3535

3636
def clean_stop(tray_icon=None):
37+
# Turn screen off before stopping
38+
display.lcd.ScreenOff()
39+
3740
# Do not stop the program now in case data transmission was in progress
3841
# Instead, ask the scheduler to empty the action queue before stopping
3942
scheduler.STOPPING = True

0 commit comments

Comments
 (0)