From b615e0b645b0a2fd91955eb480ff7e955f7e3fb6 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Mon, 30 Oct 2023 23:24:42 -0700 Subject: [PATCH] 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 --------- Co-authored-by: Martin Hjelmare --- docs/core/entity/todo.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/core/entity/todo.md b/docs/core/entity/todo.md index 2c4ba389..8ec79f32 100644 --- a/docs/core/entity/todo.md +++ b/docs/core/entity/todo.md @@ -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.""" ```