Skip to content

fix: compatibility with current Home Assistant releases (options flow, coordinator) - #22

Merged
fgrfn merged 3 commits into
mainfrom
claude/ha-integration-review-920pqh
Jul 13, 2026
Merged

fgrfn merged 3 commits into
mainfrom
claude/ha-integration-review-920pqh

Conversation

@fgrfn

@fgrfn fgrfn commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Review of the integration against current Home Assistant releases found two breaking deprecations and several smaller issues. This PR fixes them and bumps the version to 1.11.0.

Breaking on current Home Assistant (fixed)

  • Options flow crashed on HA 2025.12+: AxeOSOptionsFlowHandler explicitly assigned self.config_entry, which was deprecated in HA 2024.11 and removed in HA 2025.12. Opening the "Configure" dialog failed on up-to-date installs. The handler now relies on the config_entry property provided by the base class.
  • DataUpdateCoordinator without explicit config_entry: implicit config entry access was deprecated and stopped working in HA 2025.11. The coordinator is now created with config_entry=entry, and the initial refresh uses async_config_entry_first_refresh().

Other fixes

  • Hashrate history: the hass.data dict was replaced after the first refresh, discarding the first history sample; the update callback could also KeyError if it ran during unload. The entry dict is now created once and updated in place.
  • services.yaml offered a target: selector, but the service handlers only accept a single entity_id field — selecting a target in the UI passed a list and failed schema validation. The target blocks are removed; the explicit entity field remains.
  • Tests were broken and never ran in CI: tests/test_sensor.py imported a non-existent AxeOSSensor class and tests/test_binary_sensor.py used outdated signatures. Both are rewritten to match the actual implementation (35 tests, all passing), homeassistant was added to requirements-test.txt, and a new test.yml workflow runs pytest on pushes and PRs.

Modernization

  • FlowResultConfigFlowResult, EntityCategory imported from homeassistant.const, platform list uses the Platform enum.
  • Minimum HA version in hacs.json raised from 2022.3.0 to 2024.11.0 (required by the options flow fix); noted in README.
  • README/CHANGELOG updated (stale "Latest Version (1.0.8)" section).

Versioning

manifest.json and hacs.json both bumped to 1.11.0 (kept in sync for the version-sync workflow; minor bump because the minimum HA version changes).

Test plan

  • pytest tests/ — 35 passed locally
  • All integration modules import cleanly
  • CI workflows green (including the new Tests workflow)
  • Smoke test on a live HA 2025.12+ install: add miner, open options dialog, change scan interval

🤖 Generated with Claude Code

https://claude.ai/code/session_01Df2aQvcZsu1EsHBs4n7pDt


Generated by Claude Code

claude added 3 commits July 13, 2026 23:20
- Remove deprecated explicit self.config_entry assignment in options flow
  (removed by HA core in 2025.12; options dialog crashed on current HA)
- Pass config_entry explicitly to DataUpdateCoordinator (implicit access
  stopped working in HA 2025.11)
- Use async_config_entry_first_refresh() for the initial refresh
- Use ConfigFlowResult instead of deprecated FlowResult
- Import EntityCategory from homeassistant.const, use Platform enum
- Keep hashrate history dict across setup so the first sample is not lost
- Remove target selector from services.yaml (handlers expect a single
  entity_id field; target selection passed an incompatible list)
- Rewrite sensor/binary sensor tests to match the actual implementation
  (previously referenced non-existent AxeOSSensor class) - 35 tests passing
- Add CI workflow running pytest on pushes and pull requests
- Raise minimum Home Assistant version to 2024.11, bump version to 1.11.0

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Df2aQvcZsu1EsHBs4n7pDt
homeassistant pins an exact aiohttp version, so any additional aiohttp
constraint makes pip's resolver fail.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Df2aQvcZsu1EsHBs4n7pDt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Df2aQvcZsu1EsHBs4n7pDt
@fgrfn
fgrfn marked this pull request as ready for review July 13, 2026 23:25
@fgrfn
fgrfn merged commit 972f73e into main Jul 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants