Skip to content

Commit

Permalink
calendar data cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrfilipmarek committed Dec 13, 2024
1 parent 1e8b209 commit 827ab38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/homeassistantedupage/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ async def async_added_to_hass(self) -> None:
self.coordinator.async_add_listener(
self._handle_coordinator_update, None
)
)
)

class EdupageCalendar(CoordinatorEntity, CalendarEntity):
"""Representation of an Edupage calendar entity."""

def __init__(self, coordinator, data):
super().__init__(coordinator)
self._data = data
self._data = data
self._events = []
self._attr_name = "Edupage Calendar"
_LOGGER.debug(f"CALENDAR Initialized EdupageCalendar with data: {data}")
Expand All @@ -57,7 +57,7 @@ def name(self):
"""Return the name of the calendar."""
student_name = self.coordinator.data.get("student", {}).get("name", "Unknown Student")
return f"Edupage - {student_name}"

@property
def extra_state_attributes(self):
"""Return the extra state attributes."""
Expand Down Expand Up @@ -115,7 +115,7 @@ def get_events(self, timetable, current_date):


def map_lesson_to_calender_event(self, lesson: Lesson, day: date) -> CalendarEvent:
room = "Unknown"
room = None
if lesson.classrooms:
room = lesson.classrooms[0].name

Expand All @@ -131,7 +131,7 @@ def map_lesson_to_calender_event(self, lesson: Lesson, day: date) -> CalendarEve
start=start_time,
end=end_time,
summary= lesson_subject_prefix + lesson_subject,
description=f"Room: {room}\nTeacher(s): {teachers}",
description=f"Teacher(s): {teachers}",
location=room
)
return cal_event
Expand Down

0 comments on commit 827ab38

Please sign in to comment.