Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.shopping_list.ShoppingData Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass)
 
dict[str, JsonValueType] async_add (self, str|None name, bool complete=False, Context|None context=None)
 
Callable[[], None] async_add_listener (self, Callable[[], None] cb)
 
None async_clear_completed (self, Context|None context=None)
 
None async_load (self)
 
None async_move_item (self, str uid, str|None previous=None)
 
dict[str, JsonValueType]|None async_remove (self, str item_id, Context|None context=None)
 
list[dict[str, JsonValueType]] async_remove_items (self, set[str] item_ids, Context|None context=None)
 
None async_reorder (self, list[str] item_ids, Context|None context=None)
 
None async_sort (self, bool reverse=False, Context|None context=None)
 
dict[str, JsonValueType] async_update (self, str|None item_id, dict[str, Any] info, Context|None context=None)
 
list[dict[str, JsonValueType]] async_update_list (self, dict[str, JsonValueType] info, Context|None context=None)
 
None save (self)
 

Public Attributes

 hass
 
 items
 

Private Member Functions

None _async_notify (self)
 

Detailed Description

Class to hold shopping list data.

Definition at line 195 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.shopping_list.ShoppingData.__init__ (   self,
HomeAssistant  hass 
)
Initialize the shopping list.

Definition at line 198 of file __init__.py.

Member Function Documentation

◆ _async_notify()

None homeassistant.components.shopping_list.ShoppingData._async_notify (   self)
private
Notify all listeners that data has been updated.

Definition at line 403 of file __init__.py.

◆ async_add()

dict[str, JsonValueType] homeassistant.components.shopping_list.ShoppingData.async_add (   self,
str | None  name,
bool   complete = False,
Context | None   context = None 
)
Add a shopping list item.

Definition at line 204 of file __init__.py.

◆ async_add_listener()

Callable[[], None] homeassistant.components.shopping_list.ShoppingData.async_add_listener (   self,
Callable[[], None]  cb 
)
Add a listener to notify when data is updated.

Definition at line 394 of file __init__.py.

◆ async_clear_completed()

None homeassistant.components.shopping_list.ShoppingData.async_clear_completed (   self,
Context | None   context = None 
)
Clear completed items.

Definition at line 281 of file __init__.py.

◆ async_load()

None homeassistant.components.shopping_list.ShoppingData.async_load (   self)
Load items.

Definition at line 378 of file __init__.py.

◆ async_move_item()

None homeassistant.components.shopping_list.ShoppingData.async_move_item (   self,
str  uid,
str | None   previous = None 
)
Re-order a shopping list item.

Definition at line 341 of file __init__.py.

◆ async_remove()

dict[str, JsonValueType] | None homeassistant.components.shopping_list.ShoppingData.async_remove (   self,
str  item_id,
Context | None   context = None 
)
Remove a shopping list item.

Definition at line 223 of file __init__.py.

◆ async_remove_items()

list[dict[str, JsonValueType]] homeassistant.components.shopping_list.ShoppingData.async_remove_items (   self,
set[str]  item_ids,
Context | None   context = None 
)
Remove a shopping list item.

Definition at line 232 of file __init__.py.

◆ async_reorder()

None homeassistant.components.shopping_list.ShoppingData.async_reorder (   self,
list[str]  item_ids,
Context | None   context = None 
)
Reorder items.

Definition at line 308 of file __init__.py.

◆ async_sort()

None homeassistant.components.shopping_list.ShoppingData.async_sort (   self,
bool   reverse = False,
Context | None   context = None 
)
Sort items by name.

Definition at line 365 of file __init__.py.

◆ async_update()

dict[str, JsonValueType] homeassistant.components.shopping_list.ShoppingData.async_update (   self,
str | None  item_id,
dict[str, Any]  info,
Context | None   context = None 
)
Update a shopping list item.

Definition at line 261 of file __init__.py.

◆ async_update_list()

list[dict[str, JsonValueType]] homeassistant.components.shopping_list.ShoppingData.async_update_list (   self,
dict[str, JsonValueType]  info,
Context | None   context = None 
)
Update all items in the list.

Definition at line 292 of file __init__.py.

◆ save()

None homeassistant.components.shopping_list.ShoppingData.save (   self)
Save the items.

Definition at line 390 of file __init__.py.

Member Data Documentation

◆ hass

homeassistant.components.shopping_list.ShoppingData.hass

Definition at line 200 of file __init__.py.

◆ items

homeassistant.components.shopping_list.ShoppingData.items

Definition at line 250 of file __init__.py.


The documentation for this class was generated from the following file: