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

Integration not updating values until I reload the integration #245

Open
EinSchwerd opened this issue Feb 6, 2025 · 0 comments
Open

Integration not updating values until I reload the integration #245

EinSchwerd opened this issue Feb 6, 2025 · 0 comments

Comments

@EinSchwerd
Copy link

The integration regularly stops updating values until I reload it. I see the following exceptions in the log:
`
This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/bureau_of_meteorology/sensor.py:247
integration: Bureau of Meteorology (documentation, issues)
First occurred: 6 February 2025 at 19:07:10 (153 occurrences)
Last logged: 07:43:03

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1552, in _async_process_registry_update_or_remove
self.async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
self._async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
self.__async_calculate_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1089, in __async_calculate_state
if extra_state_attributes := self.extra_state_attributes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 247, in extra_state_attributes
attr["time_observed"] = iso8601.parse_date(self.collector.observations_data["data"][self.sensor_name]["time"]).astimezone(tzinfo).isoformat()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
`

and

'Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:609
integration: Sensor (documentation, issues)
First occurred: 6 February 2025 at 19:06:49 (2 occurrences)
Last logged: 6 February 2025 at 19:06:49

Error adding entity sensor.woronora_heights_max_temp for domain sensor with platform bureau_of_meteorology
Error adding entity sensor.woronora_heights_min_temp for domain sensor with platform bureau_of_meteorology
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 609, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 928, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1383, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 199, in async_added_to_hass
self._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 1023, in async_write_ha_state
self._async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
self.__async_calculate_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1089, in __async_calculate_state
if extra_state_attributes := self.extra_state_attributes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 247, in extra_state_attributes
attr["time_observed"] = iso8601.parse_date(self.collector.observations_data["data"][self.sensor_name]["time"]).astimezone(tzinfo).isoformat()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable'

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

1 participant