{"id":23855,"library":"homeassistant-stubs","title":"homeassistant-stubs","description":"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.","status":"active","version":"2026.4.4","language":"python","source_language":"en","source_url":"https://github.com/KapJI/homeassistant-stubs","tags":["typing","stubs","home-assistant","type-hints","mypy"],"install":[{"cmd":"pip install homeassistant-stubs","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"The stubs are generated for the corresponding homeassistant version; runtime dependency only if type checking.","package":"homeassistant","optional":true}],"imports":[{"note":"Stubs are installed alongside the package; no special import needed.","symbol":"homeassistant","correct":"import homeassistant"}],"quickstart":{"code":"import homeassistant\nfrom homeassistant.core import HomeAssistant\n\nha = HomeAssistant()\nprint('Type stubs are active')","lang":"python","description":"Basic usage verifying stubs work with mypy: no additional imports required."},"warnings":[{"fix":"Pin homeassistant-stubs to the same version as homeassistant, e.g., homeassistant-stubs==2026.4.4.","message":"Stubs must match the exact installed homeassistant version. Mismatch may cause false positives or errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Update both packages: pip install --upgrade homeassistant homeassistant-stubs","message":"Older versions may not include stubs for newer HA modules; always upgrade stubs after upgrading Home Assistant.","severity":"deprecated","affected_versions":"<2026.4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install homeassistant-stubs==<your ha version>","cause":"homeassistant-stubs not installed or version mismatch.","error":"Cannot find reference 'HomeAssistant' in 'homeassistant.core'"},{"fix":"Ignore with # type: ignore[attr-defined] or upgrade stubs.","cause":"Stubs missing for certain submodules; HA core may expose it at runtime but stubs lag.","error":"Module 'homeassistant' has no attribute 'config'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}