diff --git a/README.md b/README.md index 37cca03..495bd6d 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,6 @@ Assumes python3 as the base: * pip install -r requirements.txt * sudo pip install adafruit-circuitpython-charlcd * create your .auth.json file with a corresponding API key from GCP +* edit config.json to have a list of all the emails you want to track * edit pi-calendar-sign.py to have the calendar names that you would like to receive events for. * python pi-calendar-sign.py diff --git a/config.json b/config.json new file mode 100644 index 0000000..5e33f27 --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +[ + "(your email here)" +] \ No newline at end of file diff --git a/example.py b/example.py index 7c81baf..21cfc40 100644 --- a/example.py +++ b/example.py @@ -1,3 +1,5 @@ +import json + from calendar_grabber import CalGrab @@ -8,7 +10,10 @@ def process_events(events): def main(): - cg = CalGrab("./.auth.json", "loskorep@productiveedge.com", [process_events]) + with open("config.json") as f: + CALENDARS = json.load(f) + print(CALENDARS) + cg = CalGrab("./.auth.json", CALENDARS, [process_events]) cg.update_at_interval(5, 15) diff --git a/pi-calendar-sign.py b/pi-calendar-sign.py index 6a70675..43869af 100644 --- a/pi-calendar-sign.py +++ b/pi-calendar-sign.py @@ -1,9 +1,9 @@ -from datetime import datetime, time - import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd import board import busio +import json from pytz import timezone +from datetime import datetime, time from calendar_grabber import CalGrab @@ -11,9 +11,9 @@ TIMEZONE = timezone('US/Eastern') WORK_START = time(9, 00) WORK_STOP = time(17, 00) WORK_DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"] -CALENDARS = [ - "", -] # Add your desired calendar here +with open("config.json") as f: + CALENDARS = json.load(f) + print(CALENDARS) COLOR_RED = [100, 0, 0] COLOR_GREEN = [0, 100, 0]