mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +00:00
Conert shopping-list update to WebSockets (#2114)
This commit is contained in:
parent
bb8ec4b2ef
commit
21be35bc46
@ -16,7 +16,9 @@ export const saveEdit = (
|
|||||||
itemId: number,
|
itemId: number,
|
||||||
name: string
|
name: string
|
||||||
): Promise<ShoppingListItem> =>
|
): Promise<ShoppingListItem> =>
|
||||||
hass.callApi("POST", "shopping_list/item/" + itemId, {
|
hass.callWS({
|
||||||
|
type: "shopping_list/items/update",
|
||||||
|
item_id: itemId,
|
||||||
name,
|
name,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -25,7 +27,9 @@ export const completeItem = (
|
|||||||
itemId: number,
|
itemId: number,
|
||||||
complete: boolean
|
complete: boolean
|
||||||
): Promise<void> =>
|
): Promise<void> =>
|
||||||
hass.callApi("POST", "shopping_list/item/" + itemId, {
|
hass.callWS({
|
||||||
|
type: "shopping_list/items/update",
|
||||||
|
item_id: itemId,
|
||||||
complete,
|
complete,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user