Added support for 'last-update' feature

This commit is contained in:
Ace 2019-06-11 02:49:34 +02:00 committed by GitHub
parent 165ad83f9d
commit b53bee4870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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