Giter Club home page Giter Club logo

Comments (6)

Daanoz avatar Daanoz commented on May 17, 2024

Ah, yes, good find, added pillow with the latest release 0.4.0 and tested since only on HA 2023.2.

I just published beta version 0.4.2, would you be able to give that a try to see if it solves your problem?

from ha-google-photos.

duckpuppy avatar duckpuppy commented on May 17, 2024

First, the good news: I can successfully create the integration with 0.4.2.

The bad news: I get an error when I try to select albums (ACCESS_TOKEN_SCOPE_INSUFFICIENT). It looks like I would need to add a sensitive scope to the OAuth app in order to view Google Photos albums (.../auth/photoslibrary.readonly at the very least).

homeassistant         | Traceback (most recent call last):
homeassistant         |   File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
homeassistant         |     resp = await request_handler(request)
homeassistant         |   File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
homeassistant         |     resp = await handler(request)
homeassistant         |   File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
homeassistant         |     return await handler(request)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
homeassistant         |     return await handler(request)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
homeassistant         |     return await handler(request)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
homeassistant         |     return await handler(request)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware
homeassistant         |     return await handler(request)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
homeassistant         |     return await handler(request)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
homeassistant         |     result = await result
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 241, in post
homeassistant         |     return await super().post(request, flow_id)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
homeassistant         |     result = await method(view, request, data, *args, **kwargs)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
homeassistant         |     result = await self._flow_mgr.async_configure(flow_id, data)
homeassistant         |   File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 282, in async_configure
homeassistant         |     result = await self._async_handle_step(
homeassistant         |   File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 374, in _async_handle_step
homeassistant         |     result: FlowResult = await getattr(flow, method)(user_input)
homeassistant         |   File "/config/custom_components/google_photos/config_flow.py", line 176, in async_step_albumselect
homeassistant         |     data_schema = await self._get_albumselect_schema()
homeassistant         |   File "/config/custom_components/google_photos/config_flow.py", line 145, in _get_albumselect_schema
homeassistant         |     albums = await self.hass.async_add_executor_job(get_albums)
homeassistant         |   File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
homeassistant         |     result = self.fn(*self.args, **self.kwargs)
homeassistant         |   File "/config/custom_components/google_photos/config_flow.py", line 133, in get_albums
homeassistant         |     .execute()
homeassistant         |   File "/usr/local/lib/python3.10/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
homeassistant         |     return wrapped(*args, **kwargs)
homeassistant         |   File "/usr/local/lib/python3.10/site-packages/googleapiclient/http.py", line 938, in execute
homeassistant         |     raise HttpError(resp, content, uri=self.uri)
homeassistant         | googleapiclient.errors.HttpError: <HttpError 403 when requesting https://photoslibrary.googleapis.com/v1/albums?pageSize=50&alt=json returned "Request had insufficient authentication scopes.". Details: "[{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', 'domain': 'googleapis.com', 'metadata': {'service': 'photoslibrary.googleapis.com', 'method': 'google.photos.library.v1.PhotosLibrary.ListAlbums'}}]">

from ha-google-photos.

duckpuppy avatar duckpuppy commented on May 17, 2024

Scratch that... I deleted and re-created the Google Photos integration in HA, redid the consent screen, and though I still get that error sometimes I can get the list of albums to choose from. It seems to be working.

from ha-google-photos.

duckpuppy avatar duckpuppy commented on May 17, 2024

However... no devices or entites are created when I select an album, and If it's supposed to create the "Favorites" device by default, that's not happening either. I'm not seeing anything in the logs error-wise.

EDIT: I had to restart HA to get the devices to show up after creating the integration.

from ha-google-photos.

Daanoz avatar Daanoz commented on May 17, 2024

Hmm, ok, so it's working now? Can't really explain why it's so troublesome for you, it seems like there might have been some cached credentials or something in the way.

from ha-google-photos.

duckpuppy avatar duckpuppy commented on May 17, 2024

Yes, it's working now. Took a couple of restarts but it's working fine. At the very least, the relaxed requirement change worked 100%. Thanks for the quick response!

from ha-google-photos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.