From b53bee4870af9bdf3f62be3033573d71a3c79dd0 Mon Sep 17 00:00:00 2001 From: Ace Date: Tue, 11 Jun 2019 02:49:34 +0200 Subject: [PATCH] Added support for 'last-update' feature --- Calendar/E-Paper.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Calendar/E-Paper.py b/Calendar/E-Paper.py index 69ff432..3dd3db4 100644 --- a/Calendar/E-Paper.py +++ b/Calendar/E-Paper.py @@ -62,6 +62,7 @@ with open('/etc/timezone','r') as file: system_tz = lines[0].rstrip() local_tz = timezone(system_tz) +print('Initialising weather') owm = pyowm.OWM(api_key, language=language) """Main loop starts from here""" @@ -450,6 +451,13 @@ def main(): for events in range(len(upcoming)): write_text(314, 25, upcoming[events].name, event_positions['e'+str(events+3)], alignment = 'left') + 'Show the time of the last update if set in the settings file' + if show_last_update_time is 'True': + if hours is "24": + write_text(384, 25, 'Image created at '+now.format('H:mm'), (0, 615)) + if hours is "12": + write_text(384, 25, 'Image created at '+now.format('h:mm a'), (0, 615)) + """ Map all pixels of the generated image to red, white and black