From d4aa09722460233ceca2ee7c95bd41b40f919cb8 Mon Sep 17 00:00:00 2001 From: pepev-nrt Date: Sat, 25 Jan 2025 16:23:39 +0100 Subject: [PATCH] created raspagenda.py -> 2025-01-25 16:23:32 --- config.json | 10 ++-------- raspagenda.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index dab61bb..428b037 100644 --- a/config.json +++ b/config.json @@ -1,15 +1,9 @@ { "displayTZ": "Spain/Madrid", - "thresholdHours": 24, - "maxEventsPerDay": 3, - "isDisplayToScreen": false, - "isShutdownOnComplete": false, - "weekStartDay": 6, - "dayOfWeekText": ["L", "M", "X", "J", "V", "S", "D"], + "isDisplayConected": true, "screenWidth": 250, "screenHeight": 122, "imageWidth": 250, "imageHeight": 122, - "rotateAngle": 180, - "is24h": false, + "rotateAngle": 180 } diff --git a/raspagenda.py b/raspagenda.py index e69de29..8662d3e 100644 --- a/raspagenda.py +++ b/raspagenda.py @@ -0,0 +1,36 @@ +#!/usr/bin python3 +# -*- coding: utf-8 -*- +""" +This project is designed for the WaveShare 12.48" eInk display. Modifications will be needed for other displays, +especially the display drivers and how the image is being rendered on the display. Also, this is the first project that +I posted on GitHub so please go easy on me. There are still many parts of the code (especially with timezone +conversions) that are not tested comprehensively, since my calendar/events are largely based on the timezone I'm in. +There will also be work needed to adjust the calendar rendering for different screen sizes, such as modifying of the +CSS stylesheets in the "render" folder. +""" +import datetime as dt +import sys + + +from display.display import DisplayHelper +import json +import logging + + +def main(): + # Basic configuration settings (user replaceable) + configFile = open('config.json') + config = json.load(configFile) + + displayTZ = config['displayTZ'] # list of timezones - print(pytz.all_timezones) + isDisplayConected = config['isDisplayConected'] # set to true when debugging rendering without displaying to screen + screenWidth = config['screenWidth'] # Width of E-Ink display. Default is landscape. Need to rotate image to fit. + screenHeight = config['screenHeight'] # Height of E-Ink display. Default is landscape. Need to rotate image to fit. + imageWidth = config['imageWidth'] # Width of image to be generated for display. + imageHeight = config['imageHeight'] # Height of image to be generated for display. + rotateAngle = config['rotateAngle'] # If image is rendered in portrait orientation, angle to rotate to fit screen + + print(config) + +if __name__ == "__main__": + main() \ No newline at end of file