mirror of
https://github.com/pimoroni/grow-python
synced 2025-10-25 15:19:23 +00:00
black screen test
This commit is contained in:
@@ -975,6 +975,10 @@ def main():
|
||||
# Set up our canvas and prepare for drawing
|
||||
image = Image.new("RGBA", (DISPLAY_WIDTH, DISPLAY_HEIGHT), color=(255, 255, 255))
|
||||
|
||||
# Setup blank image for darkness
|
||||
image_blank = Image.new("RGBA", (DISPLAY_WIDTH, DISPLAY_HEIGHT), color=(255, 255, 255))
|
||||
|
||||
|
||||
# Pick a random selection of plant icons to display on screen
|
||||
channels = [
|
||||
Channel(1, 1, 1),
|
||||
@@ -1062,10 +1066,17 @@ Alarm Interval: {:.2f}s
|
||||
if channel.alarm:
|
||||
alarm.trigger()
|
||||
|
||||
alarm.update(light.get_lux() < 4.0)
|
||||
light_level_low = light.get_lux() < 4.0
|
||||
|
||||
alarm.update(light_level_low)
|
||||
|
||||
viewcontroller.update()
|
||||
viewcontroller.render()
|
||||
|
||||
if light_level_low:
|
||||
display.display(image_blank.convert("RGB"))
|
||||
|
||||
else:
|
||||
display.display(image.convert("RGB"))
|
||||
|
||||
config.set_general(
|
||||
|
||||
Reference in New Issue
Block a user