Skip to content

v2.2.0-legacy

Choose a tag to compare

@v1k70rk4 v1k70rk4 released this 05 Jun 17:35
· 37 commits to main since this release

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 calling super(), preventing self.config_entry from being injected by the framework.
  • Fix notify platform unload error — The old "ValueError: Config entry was never loaded!" is gone because notify now uses standard async_forward_entry_setups instead of discovery.async_load_platform.
  • Fix thumbnail view crash — Returns 404 instead of crashing with AttributeError when an invalid entity ID is requested.

🔄 HA 2026.x Compatibility

  • FlowResultConfigFlowResult / OptionsFlowResult — Replace deprecated type from data_entry_flow.
  • BaseNotificationServiceNotifyEntity — Full rewrite of notify.py from legacy service-based pattern to modern entity-based NotifyEntity with standard async_setup_entry.
  • utcnow()datetime.now(UTC) — Replace deprecated homeassistant.util.dt.utcnow() with Python 3.11+ native approach.

⚡ Performance

  • Synchronous requests → async aiohttp — All HTTP calls in __init__.py, config_flow.py, and notify.py now use async_get_clientsession. The event loop is no longer blocked by synchronous I/O.

🛡️ Error Handling

  • async_setup_entry now returns False with an error log if the device is unreachable, instead of crashing.
  • Config flow catches specific ClientError/TimeoutError instead of bare Exception.
  • Notification HTTP error handling simplified from 60+ line status code switch to concise response.ok check.

🧹 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_platforms call with a list

📦 Repository & HACS

  • All GitHub links updated to v1k70rk4/HASS.Agent-Integration
  • codeowners updated 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