Skip to content

Commit 1f51803

Browse files
authored
Merge pull request #840 from caternuson/stats_update
Add simple screen blanking for PiHole stats
2 parents 7d76815 + 6d1a8f4 commit 1f51803

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Pi_Hole_Ad_Blocker/stats.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
# to the right size for your display!
5050
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
5151

52+
# Leaving the OLED on for a long period of time can damage it
53+
# Set these to prevent OLED burn in
54+
DISPLAY_ON = 10 # on time in seconds
55+
DISPLAY_OFF = 50 # off time in seconds
56+
5257
# Clear display.
5358
disp.fill(0)
5459
disp.show()
@@ -125,4 +130,7 @@
125130
# Display image.
126131
disp.image(image)
127132
disp.show()
128-
time.sleep(.1)
133+
time.sleep(DISPLAY_ON)
134+
disp.fill(0)
135+
disp.show()
136+
time.sleep(DISPLAY_OFF)

0 commit comments

Comments
 (0)