Time zone undefined in ha 2024.7.0
lionslair opened this issue · 0 comments
I have got another log message since updating to 2024.7.0 also. Missing time zone. See below.
`
This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/bureau_of_meteorology/sensor.py:340
integration: Bureau of Meteorology (documentation, issues)
First occurred: 7:18:22 AM (53 occurrences)
Last logged: 11:39:10 AM
Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 411, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 165, in async_update_listeners
update_callback()
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 203, in _update_callback
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1068, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 340, in state
utc = timezone.utc
^^^^^^^^
NameError: name 'timezone' is not defined
`
Sorry duplicate of the other one I reported 10 days ago sorry