From 18040e5017e0be29fd853def0e32a38a5655aa77 Mon Sep 17 00:00:00 2001 From: thekiwismarthome <134335563+thekiwismarthome@users.noreply.github.com> Date: Sat, 14 Feb 2026 07:21:19 +1300 Subject: [PATCH] Update __init__.py --- custom_components/shopping_list_manager/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/custom_components/shopping_list_manager/__init__.py b/custom_components/shopping_list_manager/__init__.py index 50aae81..3ed43fe 100644 --- a/custom_components/shopping_list_manager/__init__.py +++ b/custom_components/shopping_list_manager/__init__.py @@ -39,9 +39,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: # Initialize storage with country storage = ShoppingListStorage(hass, component_path, country) await storage.async_load() - + + # Initialize search engine after products are loaded + self._search_engine = ProductSearch(self._products) + _LOGGER.debug("Initialized product search engine") + # Initialize image handler image_handler = ImageHandler(hass, config_path) + + self._search_engine: Optional[ProductSearch] = None # Store instances in hass.data hass.data.setdefault(DOMAIN, {})