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

google.create_event broken 'CalendarQueryUpdateCoordinator' object has no attribute 'sync' #101729

Closed
bkupidura opened this issue Oct 9, 2023 · 2 comments · Fixed by #101741
Closed
Assignees

Comments

@bkupidura
Copy link

The problem

google.create_evenservice is not able to create event.

google.add_event is working as expected but
2023-10-09 23:30:14.389 WARNING (MainThread) [homeassistant.components.google] The Google Calendar add_event service has been deprecated, and will be removed in a future Home Assistant release. Please move calls to the create_event service

What version of Home Assistant Core has the issue?

core-2023.9.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

google

Link to integration documentation on our website

https://www.home-assistant.io/integrations/google/

Diagnostics information

No response

Example YAML snippet

service: google.create_event
data:
  summary: "#test"
  start_date: "2023-10-12"
  end_date: "2023-10-13"
target:
  entity_id: calendar.calendar_name


### Anything in the logs that might be useful for us?

```txt
2023-10-09 23:29:04.118 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'CalendarQueryUpdateCoordinator' object has no attribute 'sync'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 830, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 586, in async_create_event
    ).sync.api.async_create_event(
      ^^^^
AttributeError: 'CalendarQueryUpdateCoordinator' object has no attribute 'sync'


### Additional information

_No response_
@home-assistant
Copy link

home-assistant bot commented Oct 9, 2023

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (google) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of google can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign google Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


google documentation
google source
(message by IssueLinks)

@allenporter
Copy link
Contributor

I am sending a PR to handle this case more gracefully.

This is not supported since I believe this is a synthetic calendar created to search a subset of an actual calendar, so you can't create events on it. However, you can create events on the original calendar (without a search) if desired.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants