PEP 484 typing stubs for Home Assistant Core. Provides type annotations for the homeassistant package to enable static type checking with mypy or pyright. Version 2026.4.4 tracks Home Assistant releases; updated frequently alongside HA releases.
pip install homeassistant-stubsVerified import paths — ran on the pinned version, not inferred.
Basic usage verifying stubs work with mypy: no additional imports required.
Pin homeassistant-stubs to the same version as homeassistant, e.g., homeassistant-stubs==2026.4.4.
Update both packages: pip install --upgrade homeassistant homeassistant-stubs
pip install homeassistant-stubs==<your ha version>
Ignore with # type: ignore[attr-defined] or upgrade stubs.