Closed Cptkex82 closed 1 year ago
If its relevant, reloading the integrations requires a restart with the following error:
This error originated from a custom integration.
Logger: homeassistant.config_entries
Source: custom_components/google_photos/__init__.py:80
Integration: Google Photos (documentation, issues)
First occurred: 10:45:04 (1 occurrences)
Last logged: 10:45:04
Error unloading entry kexan82@gmail.com for google_photos
Traceback (most recent call last):
File "/srv/homeassistant/venv_3.11.0/lib/python3.11/site-packages/homeassistant/config_entries.py", line 539, in async_unload
result = await component.async_unload_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/homeassistant/.homeassistant/custom_components/google_photos/__init__.py", line 80, in async_unload_entry
for service_name in hass.services.async_services()[DOMAIN]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'google_photos'
changed name of folder to fotoram_230325 and restarted and the error is gone. Could the space in the name have caused the issue? folder has 3900 images but the media count on the fotoram folder says 0. It displays the folder preview image but cant switch images.
Favourites folder shows correct number (2) though and can change image.
Extracted 127 images from fotoram album to a test album. Added and it displays the correct number of images. It would seem that the problem is related to the large number of images in fotoram?
I had a similar problem with an album with 20,000 images. A small ~200 image album worked fine, but the big one caused things to die.
Thanks for the report, will have to think how to solve this. Currently I need the entire list of media items from the album, which seems to be a problem. Maybe I can try to load them more slowly or something.
i just tried 497 images and it works. if its of any interest, im running HA core on a rpi 3b.
Had to move some stuff around to get this working in an acceptable manner. I'm a bit constrained with the Google api on solving this. Ended up with the following:
This allows the integration to start quickly, downside being that for the first couple of images that are shown the pool of items will be small when a random item is selected, but I think that's acceptable. Ideally I would only need to load all items once, but there is no way that I found I can check if the album has changed, so the only way is reloading everything.
i´ve updated the integration. The sensors dont go unavailible when i choose the 4000+ folder but its still not showing any images. The count is 0 after +1 day. tried renaming och re-adding the integration to no avail. Test album 400+ still works though so a step in the right direction. Cannot see any errors.
Hmm, that's strange, I would at least expect 100 photo's to be loaded. After reloading the integration also no error is shown? Could you try removing (Via the device page) and re-adding the album?
no errors.
ive done the following. -removed integration -removed hacs installation -rebooted -installed via hacs -rebooted -created new photos album with the old images -readded integration -checked working state (no errors) -added the "new" photo album (no errors)
As of right now, i can see a count of 400 so it seems to be working now. Must have been some old bit of settings related to the old folder perhaps?
anyways thanks for the help, this can be closed!
Alright, let me know if you run into new issues!
Version of the custom_component
0.4.3
Configuration
Describe the bug
Adding the Integrations work fine, i can see the two test images i have in favorites. Changing to the desired album (name fotoram 210130 till 230325) submits as okey, but then all sensors become unavailble.
Debug log