Repository navigation
v4.1.2 - Calendar Parsing Fixes
Calendar Parsing Bug Fixes
This release fixes critical parsing errors in calendar entities that caused TypeError and KeyError exceptions.
Fixed Issues
KeyError: 'start' in Lessons Calendar (Line 233)
- Fixed missing 'start' and 'end' keys in lesson events
- Now properly constructs datetime objects from 'date' and 'time' fields
- Parses time.from and time.to to create proper start/end datetimes
TypeError: strptime() argument 1 must be str, not datetime.date (Line 335)
- Fixed TypeError when 'date' field is already a date object
- Added isinstance() checks for both str and date types
- Handles both string dates and date objects gracefully
All Calendar Entities
- Added try-except blocks to handle malformed data
- Added logging for debugging parsing failures
- Skips invalid events instead of crashing
Installation
- Update via HACS (Redownload)
- Restart Home Assistant
- Calendar entities should now load without errors
Technical Details
Files Modified:
- calendar.py - Fixed all three async_get_events implementations
Error Messages Resolved:
- KeyError: 'start'
- TypeError: strptime() argument 1 must be str, not datetime.date
- Error handling request from 192.168.70.7
All calendar entities (Lessons, Exams, Homework) should now work correctly!