mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Adapt to new todo services (#18477)
This commit is contained in:
parent
36f7b34ac5
commit
d27b4e04a9
@ -61,7 +61,12 @@ export const updateItem = (
|
|||||||
entity_id: string,
|
entity_id: string,
|
||||||
item: TodoItem
|
item: TodoItem
|
||||||
): Promise<ServiceCallResponse> =>
|
): Promise<ServiceCallResponse> =>
|
||||||
hass.callService("todo", "update_item", item, { entity_id });
|
hass.callService(
|
||||||
|
"todo",
|
||||||
|
"update_item",
|
||||||
|
{ item: item.uid, rename: item.summary, status: item.status },
|
||||||
|
{ entity_id }
|
||||||
|
);
|
||||||
|
|
||||||
export const createItem = (
|
export const createItem = (
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
@ -70,9 +75,9 @@ export const createItem = (
|
|||||||
): Promise<ServiceCallResponse> =>
|
): Promise<ServiceCallResponse> =>
|
||||||
hass.callService(
|
hass.callService(
|
||||||
"todo",
|
"todo",
|
||||||
"create_item",
|
"add_item",
|
||||||
{
|
{
|
||||||
summary,
|
item: summary,
|
||||||
},
|
},
|
||||||
{ entity_id }
|
{ entity_id }
|
||||||
);
|
);
|
||||||
@ -84,9 +89,9 @@ export const deleteItem = (
|
|||||||
): Promise<ServiceCallResponse> =>
|
): Promise<ServiceCallResponse> =>
|
||||||
hass.callService(
|
hass.callService(
|
||||||
"todo",
|
"todo",
|
||||||
"delete_item",
|
"remove_item",
|
||||||
{
|
{
|
||||||
uid,
|
item: uid,
|
||||||
},
|
},
|
||||||
{ entity_id }
|
{ entity_id }
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user