Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error adding entities for domain calendar with platform dvla #7

Closed
markcocker opened this issue Jan 5, 2024 · 2 comments
Closed

Error adding entities for domain calendar with platform dvla #7

markcocker opened this issue Jan 5, 2024 · 2 comments

Comments

@markcocker
Copy link

markcocker commented Jan 5, 2024

I am getting the follow error in the log for each vehicle.

Environment

  • Core - 2024.1.0
  • Supervisor - 2023.12.0
  • Operating System - 11.3
  • Frontend - 20240103.3

Message in Home Assistant log

Logger: homeassistant.components.calendar
Source: helpers/entity_platform.py:507
Integration: Calendar (documentation, issues)
First occurred: 13:33:21 (2 occurrences)
Last logged: 13:33:21

Error adding entities for domain calendar with platform dvla
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1278, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 539, in async_write_ha_state
    super().async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 999, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 947, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 522, in state
    if (event := self.event) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/dvla/calendar.py", line 95, in event
    events = self.get_events(datetime.today())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dvla/calendar.py", line 102, in get_events
    value = date.fromisoformat(self.coordinator.data.get(date_sensor_type.key))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: fromisoformat: argument must be str
@dewet22
Copy link
Contributor

dewet22 commented Jan 9, 2024

@markcocker out of interest, are your vehicles new and still within their 3-year MOT grace period?

@jampez77
Copy link
Owner

Thanks for taking the time to create this issue. This has been addressed in 2024.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants