jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.
916 stars 129 forks source link

Calandar function uses depricated service #88

Closed Floris3 closed 8 months ago

Floris3 commented 8 months ago

The calendar function uses a deprecated service 'Calendar.list_events'. Use calendar.get_events instead which supports multiple entities.

image


- spec:
    name: get_events
    description: Use this function to get list of calendar events.
    parameters:
      type: object
      properties:
        start_date_time:
          type: string
          description: The start date time in '%Y-%m-%dT%H:%M:%S%z' format
        end_date_time:
          type: string
          description: The end date time in '%Y-%m-%dT%H:%M:%S%z' format
      required:
      - start_date_time
      - end_date_time
  function:
    type: script
    sequence:
   service: calendar.list_events
      data:
        start_date_time: "{{start_date_time}}"
        end_date_time: "{{end_date_time}}"
      target:
        entity_id: calendar.test
      response_variable: _function_result
jekalmin commented 8 months ago

Thanks for reporting an issue. If you don't mind, feel free to contribute to calendar function. Otherwise, I will fix it in the next release.

Floris3 commented 8 months ago

I was unfamiliar with contributing, forking and pull requests, hence the bugreport. However, I read up, was about to fork but then saw Mazon did just that. Let me add that I tested the same thing and it also works in my setup. I will however make a pull request on changing the calendar function to show that it is possible to put multiple calendars as a list, so that the assistant can give information on multiple calendars.

jekalmin commented 8 months ago

Thanks for your contribution! :D I really appreciate it!

jekalmin commented 8 months ago

Closing the issue (released in 1.0.1)