'NoneType' object has no attribute 'loop'
Hi!
Recently I've noticed the following error being spammed in my logs.
2024-04-05 00:00:04.526 ERROR (SyncWorker_9) [custom_components.icloud3] 'NoneType' object has no attribute 'loop'
Traceback (most recent call last):
File "/config/custom_components/icloud3/sensor.py", line 1259, in async_update_sensor
self.schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1213, in schedule_update_ha_state
self.hass.loop.call_soon_threadsafe(self.async_write_ha_state)
^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'loop'
Another person noticed that a few days ago. I can not reproduce it but it looks like a sensor was being updated when it didn't exist, when it had not been set up yet or when there was no data to use.
I added some code to see if the sensor had been set up before doing anything and also put another error check in to try to catch it. This was just changed at the request of balloob. See if it helps and let me know if you still see the error msg.
Unzip sensor.zip into the icloud3 directory and restart HA
Hey, sorry for the late response!
I just got around to trying it, and it seems to fix the error. Thanks :)