diff --git a/custom_components/parcelapp/carrier_detection.py b/custom_components/parcelapp/carrier_detection.py index a5e88d2..1838e96 100644 --- a/custom_components/parcelapp/carrier_detection.py +++ b/custom_components/parcelapp/carrier_detection.py @@ -342,9 +342,6 @@ def detect(self, tracking_number: str) -> list[CarrierMatch]: Returns matches sorted by confidence (highest first). """ - if not self._loaded: - self.load() - results: list[CarrierMatch] = [] for pattern in self._patterns: diff --git a/custom_components/parcelapp/services.py b/custom_components/parcelapp/services.py index d4e7913..49b4d5e 100644 --- a/custom_components/parcelapp/services.py +++ b/custom_components/parcelapp/services.py @@ -243,7 +243,7 @@ async def async_register_services(hass: HomeAssistant): session = async_get_clientsession(hass) detector = CarrierDetector() - detector.load() + await hass.async_add_executor_job(detector.load) async def async_add_parcel(call: ServiceCall): """Add a parcel to ParcelApp using the official API."""