🐛 Fix: "Detected blocking call to import_module" at startup (#47)
async_setup_entry selected its coordinator with a plain from .coordinator import GardenaCoordinator executed inside the async function — on the event loop. That first import pulls in local_channel.py → gardena_smart_local_api → pydantic, whose lazy submodule loading does real blocking file I/O (import_module / listdir / read_text). Home Assistant's blocking-call detector flagged exactly that chain.
Both deferred coordinator imports now go through homeassistant.helpers.importlib.async_import_module, which runs them on HA's dedicated import-executor thread (with a cheap sys.modules fast path for subsequent config entries). Lazy loading is preserved — a Gardena-only setup still never pays for the Automower dependency tree, and vice versa.
The same anti-pattern in the config flow's Automower credential test was found and fixed alongside it, before it could be reported separately.
🐛 Fix: Automower setup was broken on any clean install
The Automower code imported a vendored library called aioautomower, but that name was never listed in manifest.json's requirements — so Home Assistant never installed it. CI didn't catch this because CI installs the vendored library straight from the working tree. Real HACS users hit ModuleNotFoundError the moment they set up an Automower entry.
It gets sharper: aioautomower is also the name of an unrelated, established PyPI package — the one Home Assistant's built-in husqvarna_automower integration depends on — with a completely different API. Simply adding it to the requirements would have installed the wrong library and turned a clear ModuleNotFoundError into a misleading ImportError.
The vendored library is therefore now a proper standalone package, published in its own right just like aiogardenasmart:
and pinned in manifest.json, so Home Assistant installs it for real.
Were you affected? Only if you have an Automower config entry. Gardena-only setups were never impacted — every Automower import is lazy and only runs for Automower entries.
🔒 Guardrail
The CI library-version-sync check now iterates over every vendored library and fails if one is missing from manifest.json entirely — closing the exact gap this shipped through.
Quality
739 tests · mypy --strict clean · ruff clean · Hassfest + HACS green. The #47 fix ships with regression tests that assert the import executor is actually used — verified to fail against the pre-fix code, not just to pass against the new one.
Full changelog: v2.1.1...v2.1.2