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
|
# Set up our canvas and prepare for drawing
|
||||||
image = Image.new("RGBA", (DISPLAY_WIDTH, DISPLAY_HEIGHT), color=(255, 255, 255))
|
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
|
# Pick a random selection of plant icons to display on screen
|
||||||
channels = [
|
channels = [
|
||||||
Channel(1, 1, 1),
|
Channel(1, 1, 1),
|
||||||
@@ -1062,11 +1066,18 @@ Alarm Interval: {:.2f}s
|
|||||||
if channel.alarm:
|
if channel.alarm:
|
||||||
alarm.trigger()
|
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.update()
|
||||||
viewcontroller.render()
|
viewcontroller.render()
|
||||||
display.display(image.convert("RGB"))
|
|
||||||
|
if light_level_low:
|
||||||
|
display.display(image_blank.convert("RGB"))
|
||||||
|
|
||||||
|
else:
|
||||||
|
display.display(image.convert("RGB"))
|
||||||
|
|
||||||
config.set_general(
|
config.set_general(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user