created raspagenda.py -> 2025-01-25 16:23:32
This commit is contained in:
parent
11733c3495
commit
d4aa097224
2 changed files with 38 additions and 8 deletions
10
config.json
10
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
|
||||
}
|
||||
|
|
|
@ -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()
|
Loading…
Add table
Add a link
Reference in a new issue