General improvements
Added 2 more lines for events below the Calendar which is utilised when there is free space below the monthly Calendar.
This commit is contained in:
parent
24f6172c86
commit
fd48d75077
@ -1,28 +1,36 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from PIL import Image, ImageFont
|
"""
|
||||||
from settings import *
|
This file contains all the locations of the icons used.
|
||||||
|
It also contains the positions of these icons on the E-Paper display
|
||||||
|
"""
|
||||||
|
|
||||||
|
from PIL import Image
|
||||||
|
from settings import language
|
||||||
im_open = Image.open
|
im_open = Image.open
|
||||||
|
|
||||||
path = '/home/pi/E-Paper-Master/Calendar/'
|
path = '/home/pi/E-Paper-Master/Calendar/'
|
||||||
wpath = path+'weather-icons/'
|
wpath = path+'weather-icons/'
|
||||||
mpath = path+'translations/'+language+'/months/'
|
mpath = path+'translations/'+language+'/months/'
|
||||||
weekpath = path+'translations/'+language+'/week/'
|
weekpath = path+'translations/'+language+'/week/'
|
||||||
dpath = path+'days/'
|
dpath = path+'days/'
|
||||||
opath = path+'other/'
|
opath = path+'other/'
|
||||||
|
|
||||||
weekday = im_open(opath+'weekday.bmp').convert('L')
|
weekday = im_open(opath+'weekday.bmp').convert('L')
|
||||||
eventicon = im_open(opath+'event.bmp').convert('L')
|
eventicon = im_open(opath+'event.bmp').convert('L')
|
||||||
dateicon = im_open(opath+'today.bmp').convert('L')
|
dateicon = im_open(opath+'today.bmp').convert('L')
|
||||||
tempicon = im_open(opath+'temperature.jpeg')
|
tempicon = im_open(opath+'temperature.jpeg')
|
||||||
humicon = im_open(opath+'humidity.jpeg')
|
humicon = im_open(opath+'humidity.jpeg')
|
||||||
weekmon = im_open(weekpath+'week-mon.jpeg')
|
weekmon = im_open(weekpath+'week-mon.jpeg')
|
||||||
weeksun = im_open(weekpath+'week-sun.jpeg')
|
weeksun = im_open(weekpath+'week-sun.jpeg')
|
||||||
seperator = im_open(opath+'seperator.jpeg').convert('L')
|
seperator = im_open(opath+'seperator.jpeg').convert('L')
|
||||||
no_response= im_open(opath+'cloud-no-response.jpeg')
|
no_response = im_open(opath+'cloud-no-response.jpeg')
|
||||||
sunriseicon = im_open(opath+'wi-sunrise.jpeg')
|
sunriseicon = im_open(opath+'wi-sunrise.jpeg')
|
||||||
sunseticon = im_open(opath+'wi-sunset.jpeg')
|
sunseticon = im_open(opath+'wi-sunset.jpeg')
|
||||||
windicon = im_open(opath+'wi-strong-wind.jpeg')
|
windicon = im_open(opath+'wi-strong-wind.jpeg')
|
||||||
|
black = im_open(opath+'black.jpeg')
|
||||||
|
white = im_open(opath+'white.jpeg')
|
||||||
|
red = im_open(opath+'red.jpeg')
|
||||||
|
|
||||||
wiconplace = (0, 0)
|
wiconplace = (0, 0)
|
||||||
tempplace = (299, 0)
|
tempplace = (299, 0)
|
||||||
@ -37,19 +45,22 @@ sunsetplace = (214, 35)
|
|||||||
e_col = 70
|
e_col = 70
|
||||||
date_col = 0
|
date_col = 0
|
||||||
|
|
||||||
e_row_1 = 540
|
e_row_1 = 490
|
||||||
e_row_2 = 565
|
e_row_2 = 515
|
||||||
e_row_3 = 590
|
e_row_3 = 540
|
||||||
e_row_4 = 615
|
e_row_4 = 565
|
||||||
|
e_row_5 = 590
|
||||||
|
e_row_6 = 615
|
||||||
|
|
||||||
event_positions = {
|
event_positions = {
|
||||||
'e1': (e_col, e_row_1), 'e2': (e_col, e_row_2), 'e3': (e_col, e_row_3),
|
'e1': (e_col, e_row_1), 'e2': (e_col, e_row_2), 'e3': (e_col, e_row_3),
|
||||||
'e4': (e_col, e_row_4)
|
'e4': (e_col, e_row_4), 'e5': (e_col, e_row_5), 'e6': (e_col, e_row_6)
|
||||||
}
|
}
|
||||||
|
|
||||||
date_positions = {
|
date_positions = {
|
||||||
'd1': (date_col, e_row_1), 'd2': (date_col, e_row_2), 'd3': (date_col, e_row_3),
|
'd1': (date_col, e_row_1), 'd2': (date_col, e_row_2),
|
||||||
'd4': (date_col, e_row_4)
|
'd3': (date_col, e_row_3), 'd4': (date_col, e_row_4),
|
||||||
|
'd5': (date_col, e_row_5), 'd6': (date_col, e_row_6)
|
||||||
}
|
}
|
||||||
|
|
||||||
col1 = 3
|
col1 = 3
|
||||||
@ -68,47 +79,46 @@ row5 = 414
|
|||||||
row6 = 477
|
row6 = 477
|
||||||
|
|
||||||
positions = {
|
positions = {
|
||||||
'a1': (col1, row1), 'a2': (col2, row1), 'a3': (col3, row1), 'a4': (col4, row1),
|
'a1': (col1, row1), 'a2': (col2, row1), 'a3': (col3, row1), 'a4': (col4, row1),
|
||||||
'a5': (col5, row1), 'a6': (col6, row1), 'a7': (col7, row1),
|
'a5': (col5, row1), 'a6': (col6, row1), 'a7': (col7, row1),
|
||||||
|
|
||||||
'b1': (col1, row2), 'b2': (col2, row2), 'b3': (col3, row2), 'b4': (col4, row2),
|
'b1': (col1, row2), 'b2': (col2, row2), 'b3': (col3, row2), 'b4': (col4, row2),
|
||||||
'b5': (col5, row2), 'b6': (col6, row2), 'b7': (col7, row2),
|
'b5': (col5, row2), 'b6': (col6, row2), 'b7': (col7, row2),
|
||||||
|
|
||||||
'c1': (col1, row3), 'c2': (col2, row3), 'c3': (col3, row3), 'c4': (col4, row3),
|
'c1': (col1, row3), 'c2': (col2, row3), 'c3': (col3, row3), 'c4': (col4, row3),
|
||||||
'c5': (col5, row3), 'c6': (col6, row3), 'c7': (col7, row3),
|
'c5': (col5, row3), 'c6': (col6, row3), 'c7': (col7, row3),
|
||||||
|
|
||||||
'd1': (col1, row4), 'd2': (col2, row4), 'd3': (col3, row4), 'd4': (col4, row4),
|
'd1': (col1, row4), 'd2': (col2, row4), 'd3': (col3, row4), 'd4': (col4, row4),
|
||||||
'd5': (col5, row4), 'd6': (col6, row4), 'd7': (col7, row4),
|
'd5': (col5, row4), 'd6': (col6, row4), 'd7': (col7, row4),
|
||||||
|
|
||||||
'e1': (col1, row5), 'e2': (col2, row5), 'e3': (col3, row5), 'e4': (col4, row5),
|
'e1': (col1, row5), 'e2': (col2, row5), 'e3': (col3, row5), 'e4': (col4, row5),
|
||||||
'e5': (col5, row5), 'e6': (col6, row5), 'e7': (col7, row5),
|
'e5': (col5, row5), 'e6': (col6, row5), 'e7': (col7, row5),
|
||||||
|
|
||||||
'f1': (col1, row6), 'f2': (col2, row6), 'f3': (col3, row6), 'f4': (col4, row6),
|
'f1': (col1, row6), 'f2': (col2, row6), 'f3': (col3, row6), 'f4': (col4, row6),
|
||||||
'f5': (col5, row6), 'f6': (col6, row6), 'f7': (col7, row6)
|
'f5': (col5, row6), 'f6': (col6, row6), 'f7': (col7, row6)
|
||||||
}
|
}
|
||||||
|
|
||||||
week_row = 134
|
week_row = 134
|
||||||
|
|
||||||
weekdaysmon = {
|
weekdaysmon = {
|
||||||
'Mon': (col1,week_row), 'Tue': (col2,week_row), 'Wed': (col3,week_row),
|
'Mon': (col1, week_row), 'Tue': (col2, week_row), 'Wed': (col3, week_row),
|
||||||
'Thu': (col4,week_row), 'Fri': (col5,week_row), 'Sat': (col6,week_row),
|
'Thu': (col4, week_row), 'Fri': (col5, week_row), 'Sat': (col6, week_row),
|
||||||
'Sun': (col7,week_row)
|
'Sun': (col7, week_row)
|
||||||
}
|
}
|
||||||
|
|
||||||
weekdayssun = {
|
weekdayssun = {
|
||||||
'Sun': (col1,week_row), 'Mon': (col2,week_row), 'Tue': (col3,week_row),
|
'Sun': (col1, week_row), 'Mon': (col2, week_row), 'Tue': (col3, week_row),
|
||||||
'Wed': (col4,week_row), 'Thu': (col5,week_row), 'Fri': (col6,week_row),
|
'Wed': (col4, week_row), 'Thu': (col5, week_row), 'Fri': (col6, week_row),
|
||||||
'Sat': (col7,week_row)
|
'Sat': (col7, week_row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
weathericons = {
|
weathericons = {
|
||||||
'01d': 'wi-day-sunny', '02d':'wi-day-cloudy', '03d': 'wi-cloudy',
|
'01d': 'wi-day-sunny', '02d':'wi-day-cloudy', '03d': 'wi-cloudy',
|
||||||
'04d': 'wi-cloudy-windy', '09d': 'wi-showers', '10d':'wi-rain',
|
'04d': 'wi-cloudy-windy', '09d': 'wi-showers', '10d':'wi-rain',
|
||||||
'11d':'wi-thunderstorm', '13d':'wi-snow', '50d': 'wi-fog',
|
'11d':'wi-thunderstorm', '13d':'wi-snow', '50d': 'wi-fog',
|
||||||
'01n': 'wi-night-clear', '02n':'wi-night-cloudy',
|
'01n': 'wi-night-clear', '02n':'wi-night-cloudy',
|
||||||
'03n': 'wi-night-cloudy', '04n': 'wi-night-cloudy',
|
'03n': 'wi-night-cloudy', '04n': 'wi-night-cloudy',
|
||||||
'09n': 'wi-night-showers', '10n':'wi-night-rain',
|
'09n': 'wi-night-showers', '10n':'wi-night-rain',
|
||||||
'11n':'wi-night-thunderstorm', '13n':'wi-night-snow',
|
'11n':'wi-night-thunderstorm', '13n':'wi-night-snow',
|
||||||
'50n': 'wi-night-alt-cloudy-windy'}
|
'50n': 'wi-night-alt-cloudy-windy'
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user