Discovered that the integration no longer provides any sensors. Tried updating Home Assistant, which made no difference. I'm guessing a previous update of Home Assistant broke this integration. It seems like event_time is no longer getting fetched, and becomes a NoneType object which breaks the integration.
Traceback (most recent call last):
File "/config/custom_components/lunar_phase/coordinator.py", line 38, in _async_update_data
attributes = await self.hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.moon_calc.get_moon_attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/lunar_phase/moon.py", line 169, in get_moon_attributes
STATE_ATTR_NEXT_RISE: self.get_event_time("rise"),
~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/config/custom_components/lunar_phase/moon.py", line 111, in get_event_time
return event_time.astimezone(config_timezone)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'astimezone'
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 419, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/lunar_phase/coordinator.py", line 47, in _async_update_data
raise UpdateFailed(f"Error updating data: {err}") from err
homeassistant.helpers.update_coordinator.UpdateFailed: Error updating data: 'NoneType' object has no attribute 'astimezone'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/lunar_phase/__init__.py", line 43, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 318, in async_config_entry_first_refresh
await self._async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 352, in _async_config_entry_first_refresh
raise ex
homeassistant.exceptions.ConfigEntryNotReady: Error updating data: 'NoneType' object has no attribute 'astimezone'
Short summary 📝
Integration suddenly stopped working altogether, due to a NoneType object
Detailed description 📋
Discovered that the integration no longer provides any sensors. Tried updating Home Assistant, which made no difference. I'm guessing a previous update of Home Assistant broke this integration. It seems like
event_timeis no longer getting fetched, and becomes aNoneTypeobject which breaks the integration.Version 📌
0.2.2
Environment 🌐
Logs and screenshots 📂