Update __init__.py

This commit is contained in:
thekiwismarthome
2026-02-14 07:21:19 +13:00
committed by GitHub
parent 76d0eed1d6
commit 18040e5017
@@ -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, {})