adding back true that got deleted somehow - should probably just sleep instead of fixing stupid errors.
This commit is contained in:
+6
-4
@@ -1,8 +1,10 @@
|
||||
from datetime import datetime, time
|
||||
|
||||
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
|
||||
import board
|
||||
import busio
|
||||
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
|
||||
|
||||
from datetime import datetime, time
|
||||
|
||||
from pytz import timezone
|
||||
|
||||
from calendar_grabber import CalGrab
|
||||
@@ -25,12 +27,11 @@ lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
|
||||
def is_event_active(events, now):
|
||||
for event in events:
|
||||
if event.start_time < now and event.end_time > now:
|
||||
|
||||
return True
|
||||
|
||||
def is_work_time(now):
|
||||
return now < WORK_STOP and now > WORK_START
|
||||
|
||||
|
||||
def update_display(color, text, cursor = False, blink = False):
|
||||
print(text)
|
||||
lcd.color = color
|
||||
@@ -43,6 +44,7 @@ def process_events(events):
|
||||
now = datetime.now(tz=TIMEZONE)
|
||||
print("PROCESSING EVENTS")
|
||||
is_working_time = is_work_time(now.time())
|
||||
print(is_working_time)
|
||||
if is_event_active(events, now):
|
||||
if is_working_time:
|
||||
update_display(color=COLOR_RED, text="Meeting in Progress")
|
||||
|
||||
Reference in New Issue
Block a user