From 28809fc7fd04ee318c528ee7921a79877b3f58ea Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Sat, 1 Oct 2022 23:07:27 -0700 Subject: [PATCH] Remove dead code code in calendar (#79450) --- homeassistant/components/calendar/__init__.py | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/homeassistant/components/calendar/__init__.py b/homeassistant/components/calendar/__init__.py index cfbe038c251..213376b2081 100644 --- a/homeassistant/components/calendar/__init__.py +++ b/homeassistant/components/calendar/__init__.py @@ -133,32 +133,6 @@ def _get_api_date(dt_or_d: datetime.datetime | datetime.date) -> dict[str, str]: return {"date": dt_or_d.isoformat()} -def normalize_event(event: dict[str, Any]) -> dict[str, Any]: - """Normalize a calendar event.""" - normalized_event: dict[str, Any] = {} - - start = event.get("start") - end = event.get("end") - start = get_date(start) if start is not None else None - end = get_date(end) if end is not None else None - normalized_event["dt_start"] = start - normalized_event["dt_end"] = end - - start = start.strftime(DATE_STR_FORMAT) if start is not None else None - end = end.strftime(DATE_STR_FORMAT) if end is not None else None - normalized_event["start"] = start - normalized_event["end"] = end - - # cleanup the string so we don't have a bunch of double+ spaces - summary = event.get("summary", "") - normalized_event["message"] = re.sub(" +", "", summary).strip() - normalized_event["location"] = event.get("location", "") - normalized_event["description"] = event.get("description", "") - normalized_event["all_day"] = "date" in event["start"] - - return normalized_event - - def extract_offset(summary: str, offset_prefix: str) -> tuple[str, datetime.timedelta]: """Extract the offset from the event summary.