From 1be6ac4854e41957597554ae5e2194b2ba389c90 Mon Sep 17 00:00:00 2001 From: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:19:47 +0100 Subject: [PATCH] Remove deprecated service list_events in favor of get_events (#30196) * Deprecate service list_events in favor of get_events - The service `calendar.list_events` is deprecated in favor or `calendar.get_events` - in 2023.12. Scheduled to be removed in 2024.6 - This PR adds a note that this service is deprecated - The docs for `get_events` are a topic for a separate PR - Unlike list_events, get_events supports multiple responses - related parent PR in core: https://github.com/home-assistant/core/pull/102481 * remove newlines * Remove dates to align with format of other deprecation notices * WIP: add calendar.list_events * Add example of get_event, remove list_event * Fix exmaple in service-calls --- source/_docs/scripts/service-calls.markdown | 7 +++-- source/_integrations/calendar.markdown | 29 +++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/source/_docs/scripts/service-calls.markdown b/source/_docs/scripts/service-calls.markdown index d153233b4ca..03424e8a7d6 100644 --- a/source/_docs/scripts/service-calls.markdown +++ b/source/_docs/scripts/service-calls.markdown @@ -133,13 +133,12 @@ Examples of service response data are upcoming calendar events for the next week Templates can also be used for handling response data. The service call can specify a `response_variable`. This is the [variable](/docs/scripts/#variables) -that contains the response data. You can define any name for your `response_variable`. This example calls a service and stores the response in -the variable called `agenda`. +that contains the response data. You can define any name for your `response_variable`. This example calls a service and stores the response in the variable called `agenda`. {% raw %} ```yaml -service: calendar.list_events +service: calendar.get_events target: entity_id: calendar.school data: @@ -168,7 +167,7 @@ data: message: >- Your agenda for today:
- {% for event in agenda.events %}
+ {% for event in agenda['calendar.school'].events %}
{{ event.start}}: {{ event.summary }}
{% endfor %}
- {% for event in agenda.events %}
+ Your school calendar for today:
+ {% for event in agenda["calendar.school_calendar"]["events"] %}
+ {{ event.start}}: {{ event.summary }}
+ {% endfor %}
+ Your work calendar for today:
+ {% for event in agenda["calendar.work_calendar"]["events"] %}
{{ event.start}}: {{ event.summary }}
{% endfor %}
-