Skip to content

Commit f46b511

Browse files
authored
Add update APIs for Calendar Entities (home-assistant#1590)
1 parent 3c8bdb4 commit f46b511

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/core/entity/calendar.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and are combined using the bitwise or (`|`) operator.
3535
| ------------------- | ------------------------------------------------------------------ |
3636
| `CREATE_EVENT` | Entity implements the methods to allow creation of events. |
3737
| `DELETE_EVENT` | Entity implements the methods to allow deletion of events. |
38+
| `UPDATE_EVENT` | Entity implements the methods to allow update of events. |
3839

3940

4041
## Methods
@@ -92,6 +93,29 @@ class MyCalendar(CalendarEntity):
9293
"""Delete an event on the calendar."""
9394
```
9495

96+
### Update Events
97+
98+
A calendar entity may support deleting events by specifying the `UPDATE_EVENT` supported feature. Integrations that support mutation must support rfc5545 recurring events.
99+
100+
There are three ways that recurring events may be deleted:
101+
- Specifying only the `uid` will update the entire series
102+
- Specifying the `uid` and `recurrence_id` will update the specific event instance in the series
103+
- Specifying `uid`, `recurrence_id`, and a `recurrence_range` value may update a range of events starting at `recurrence_id`. Currently rfc5545 allows the [range](https://www.rfc-editor.org/rfc/rfc5545#section-3.2.13) value of `THISANDFUTURE`.
104+
105+
```python
106+
class MyCalendar(CalendarEntity):
107+
108+
async def async_update_event(
109+
self,
110+
uid: str,
111+
event: dict[str, Any],
112+
recurrence_id: str | None = None,
113+
recurrence_range: str | None = None,
114+
) -> None:
115+
"""Delete an event on the calendar."""
116+
```
117+
118+
95119
## CalendarEvent
96120

97121
A `CalendarEvent` represents an individual event on a calendar.

0 commit comments

Comments
 (0)