mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-09 18:36:29 +00:00
Update todo move item API to reference previous uid (#1958)
* Update todo move item API * Update docs/core/entity/todo.md Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
5412821eb4
commit
b615e0b645
@ -83,7 +83,7 @@ class MyTodoListEntity(TodoListEntity):
|
||||
|
||||
A To-do list entity may support re-ordering To-do items in the list by specifying
|
||||
the `MOVE_TODO_ITEM` supported feature. The To-do item with the specified `uid`
|
||||
should be moved to the position in the list specified by `pos` (`0` is the first
|
||||
should be moved to the position in the list after the one specified by `previous_uid` (`None` means move to the first
|
||||
position in the To-do list).
|
||||
|
||||
```python
|
||||
@ -91,7 +91,11 @@ from homeassistant.components.todo import TodoListEntity
|
||||
|
||||
class MyTodoListEntity(TodoListEntity):
|
||||
|
||||
async def async_move_todo_item(self, uid: str, pos: int) -> None:
|
||||
async def async_move_todo_item(
|
||||
self,
|
||||
uid: str,
|
||||
previous_uid: str | None = None
|
||||
) -> None:
|
||||
"""Move an item in the To-do list."""
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user