elahd/ha-nyc311

Another status

michaelliebman opened this issue · 1 comments

It looks like another status has started showing up and is throwing errors.

This error originated from a custom integration.

Logger: custom_components.nyc311
Source: custom_components/nyc311/__init__.py:39
Integration: NYC 311 Public Services Calendar (documentation, issues)
First occurred: 10:57:51 AM (191 occurrences)
Last logged: 3:08:45 PM

Unexpected error fetching nyc311 data:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nyc311calendar/api.py", line 209, in __async_calendar_update
    status_id = self.KNOWN_STATUSES[item["status"]]["id"]
KeyError: 'NO INFORMATION'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/nyc311/__init__.py", line 39, in async_update_data
    return await api.get_calendar(
  File "/usr/local/lib/python3.9/site-packages/nyc311calendar/api.py", line 168, in get_calendar
    api_resp = await self.__async_calendar_update(start_date, end_date, scrub)
  File "/usr/local/lib/python3.9/site-packages/nyc311calendar/api.py", line 224, in __async_calendar_update
    raise self.UnexpectedEntry from error
nyc311calendar.api.NYC311API.UnexpectedEntry

Logger: nyc311calendar.api
Source: /usr/local/lib/python3.9/site-packages/nyc311calendar/api.py:215
First occurred: 10:57:51 AM (191 occurrences)
Last logged: 3:08:45 PM

Encountered unknown service or status. Please report this to the developers using the "Unknown Service or Status" bug template at https://github.com/elahd/nyc311calendar/issues/new/choose. ===BEGIN COPYING HERE=== Item ID: Information Not Available Day: {'today_id': '20220628', 'items': [{'details': 'Alternate side parking and meters are in effect. Follow the ASP Reform rule for residential streets: If an ASP sign shows more than one day, only the last day is in effect for that side of the street.', 'status': 'IN EFFECT', 'type': 'Alternate Side Parking'}, {'details': 'Trash and recycling collections are on schedule. Compost collections in participating neighborhoods are also on schedule.', 'status': 'ON SCHEDULE', 'type': 'Collections'}, {'exceptionName': 'Information Not Available', 'details': 'Public school information is not available for this date.', 'status': 'NO INFORMATION', 'type': 'Schools'}]} ===END COPYING HERE===
elahd commented

Fixed along with #9 in v0.1.1.