v2.2.0-legacy
Modernize HASS.Agent Integration for HA 2026.x
Summary
Full modernization of the HASS.Agent custom integration to ensure compatibility with Home Assistant 2026.x, fix known bugs, and align with current HA development best practices.
🐛 Bug Fixes
- Fix Configure button 500 error (PR #59 / Issue #61) — Removed broken
OptionsFlowHandler.__init__that overwrote the parent without callingsuper(), preventingself.config_entryfrom being injected by the framework. - Fix notify platform unload error — The old
"ValueError: Config entry was never loaded!"is gone because notify now uses standardasync_forward_entry_setupsinstead ofdiscovery.async_load_platform. - Fix thumbnail view crash — Returns 404 instead of crashing with
AttributeErrorwhen an invalid entity ID is requested.
🔄 HA 2026.x Compatibility
FlowResult→ConfigFlowResult/OptionsFlowResult— Replace deprecated type fromdata_entry_flow.BaseNotificationService→NotifyEntity— Full rewrite ofnotify.pyfrom legacy service-based pattern to modern entity-basedNotifyEntitywith standardasync_setup_entry.utcnow()→datetime.now(UTC)— Replace deprecatedhomeassistant.util.dt.utcnow()with Python 3.11+ native approach.
⚡ Performance
- Synchronous
requests→ asyncaiohttp— All HTTP calls in__init__.py,config_flow.py, andnotify.pynow useasync_get_clientsession. The event loop is no longer blocked by synchronous I/O.
🛡️ Error Handling
async_setup_entrynow returnsFalsewith an error log if the device is unreachable, instead of crashing.- Config flow catches specific
ClientError/TimeoutErrorinstead of bareException. - Notification HTTP error handling simplified from 60+ line status code switch to concise
response.okcheck.
🧹 Code Cleanup
- Removed ~15 unused imports (
asyncio,Coroutine,suppress,Path,cast,SOURCE_IMPORT,SERVICE_RELOAD,slugify,discovery,requests, etc.) - Removed commented-out code blocks (notify unload workaround)
- Simplified platform unload to single
async_unload_platformscall with a list
📦 Repository & HACS
- All GitHub links updated to
v1k70rk4/HASS.Agent-Integration codeownersupdated to@v1k70rk4- HACS version set to
20260601.1 - Minimum HA version bumped to
2024.1
Changed Files
| File | What changed |
|---|---|
| init.py | Async HTTP, cleaned imports, notify uses async_forward_entry_setups, unified platform unload |
| config_flow.py | Removed broken init, typed flow results, requests → aiohttp |
| notify.py | Full rewrite: BaseNotificationService → NotifyEntity |
| media_player.py | utcnow() → datetime.now(UTC), removed unused import |
| views.py | Null-safety checks, returns 404 instead of crashing |
| repairs.py | Updated FlowResult import |
| manifest.json | Repo URLs + codeowners → v1k70rk4 |
| hacs.json | Version 20260601.1, min HA 2024.1 |
| README.md | All links → v1k70rk4 repo |