ha-sun2 icon indicating copy to clipboard operation
ha-sun2 copied to clipboard

Error when using update_location

Open stigvi opened this issue 10 months ago • 3 comments

It happens when I run the service update_location:

domain: sun2 service: update_location service_data: location: phone latitude: 58.7735959 longitude: 5.725744 time_zone: Europe/Oslo

2024-04-22 06:24:44.538 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/sun2/helpers.py", line 489, in update_entity await entity.async_request_call(entity.update_astral_data(astral_data)) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1580, in async_request_call return await coro ^^^^^^^^^^ File "/config/custom_components/sun2/helpers.py", line 345, in update_astral_data self._update_astral_data(astral_data) File "/config/custom_components/sun2/helpers.py", line 351, in _update_astral_data self._setup_fixed_updating() File "/config/custom_components/sun2/sensor.py", line 204, in _setup_fixed_updating self._unsub_update = async_track_point_in_utc_time( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1497, in async_track_point_in_utc_time track.async_attach() File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1447, in async_attach loop = self.hass.loop ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'loop' 2024-04-22 06:24:44.540 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/sun2/helpers.py", line 490, in update_entity await entity.async_update_ha_state(True) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_update_ha_state raise RuntimeError(f"Attribute hass is None for {self}") RuntimeError: Attribute hass is None for entity unknown.unknown=unknown

stigvi avatar Apr 22 '24 04:04 stigvi

Thanks. I think I may know why this is happening. I'll try to fix it soon.

pnbruckner avatar Apr 22 '24 20:04 pnbruckner

@stigvi please let me know if the 3.3.0b3 release fixes the issue.

pnbruckner avatar Apr 23 '24 15:04 pnbruckner

@stigvi please let me know if the 3.3.0b3 release fixes the issue.

Sorry about being late about this. But I have been on travel and have used this feature a lot the last weeks. And there is no more error messages in the log.

stigvi avatar May 08 '24 10:05 stigvi