Update cal2-4.py
This is the main python script that controls the E-paper display.
This commit is contained in:
		| @@ -14,15 +14,8 @@ from calibration import calibration | |||||||
|  |  | ||||||
| epd = epd7in5b.EPD() #required | epd = epd7in5b.EPD() #required | ||||||
| epd.init() #required | epd.init() #required | ||||||
| """ |  | ||||||
| Attention: Yahoo Calendar urls (for ics) may not work if there is an issue |  | ||||||
| with their servers. If you are expierencing issues, you might want to use google |  | ||||||
| calendar. |  | ||||||
| """ |  | ||||||
|  |  | ||||||
| #google#url = "https://calendar.google.com/calendar/ical/5r4fb74fncg569g17tqc941vco%40group.calendar.google.com/private-5e7bc80e93055e1fbc41ec358b2babab/basic.ics" | url = "please past a valid calendar url here" | ||||||
| #yahoo calendar might not be so reliable in the long term. |  | ||||||
| url = "https://calendar.yahoo.com/saadnaseer63/9607e906db373c21566df3824b05e127/ycal.ics?id=1246" |  | ||||||
| calendar.setfirstweekday(calendar.MONDAY) #mon or sun | calendar.setfirstweekday(calendar.MONDAY) #mon or sun | ||||||
|  |  | ||||||
| c = Calendar(urlopen(url).read().decode('UTF-8')) #was 'iso-8859-1' | c = Calendar(urlopen(url).read().decode('UTF-8')) #was 'iso-8859-1' | ||||||
| @@ -127,9 +120,6 @@ def main(): | |||||||
|             weathericon = weather.get_weather_icon_name() |             weathericon = weather.get_weather_icon_name() | ||||||
|             Temperature = str(int(weather.get_temperature(unit='celsius')['temp'])) |             Temperature = str(int(weather.get_temperature(unit='celsius')['temp'])) | ||||||
|             Humidity = str(weather.get_humidity()) |             Humidity = str(weather.get_humidity()) | ||||||
|             #print('weather icon:', weathericon) -->debug |  | ||||||
|             #print('Temperature:', Temperature + '°C') -->debug |  | ||||||
|             #print('Humidity:', Humidity+' %') -->debug |  | ||||||
|              |              | ||||||
|             #weather icon handler |             #weather icon handler | ||||||
|             draw(wiconplace, open(wpath+weathericons[weathericon]+'.bmp')) |             draw(wiconplace, open(wpath+weathericons[weathericon]+'.bmp')) | ||||||
| @@ -174,8 +164,7 @@ def main(): | |||||||
|                     if str(time.month) in str((events.begin).format('M')): |                     if str(time.month) in str((events.begin).format('M')): | ||||||
|                         elist.append(int((events.begin).format('D'))) |                         elist.append(int((events.begin).format('D'))) | ||||||
|  |  | ||||||
|             print('In this month, you have',len(elist),'Events') # -->debug |             print('In this month, you have',len(elist),'Events') | ||||||
|             #cal = calendar.monthcalendar(time.year, time.month) |  | ||||||
|              |              | ||||||
|             for x in elist: |             for x in elist: | ||||||
|                 if x in cal[0]: |                 if x in cal[0]: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user