Test against current Home Assistant, depend on the pyaltherma fork, add CI and security scans #1

Merged
tim merged 8 commits from chore/maintenance-2026-10 into main 2026-10-12 12:39:08 +00:00
Owner

Maintenance run. Nine commits.

Findings

  • The test requirements were two years stale: pytest-homeassistant-custom-component==0.13.316 pinned an old Home Assistant. With the plugin floor at 0.13.372 the suite runs against Home Assistant 2026.10.1 on Python 3.14.
  • That exposed one failing test: after the config flow created the entry, Home Assistant set it up, and setup used the real DaikinWSConnection (only the config flow's classes were patched), so it dialled 192.168.1.50 and the plugin blocked the socket. The test now patches async_setup_entry.
  • pyaltherma (the runtime dependency) has been idle since February 2023 (last release 0.0.21, 7 open issues). It is forked as tim/pyaltherma and released as 0.1.0 (tim/pyaltherma!1, merged, tag v0.1.0 exists).
  • No usable CI existed: only the upstream GitHub workflows (hassfest, HACS validation), which never run on Forgejo.
  • hassfest found two real manifest errors in my own earlier commit on this branch: homeassistant is not a valid manifest key (the minimum version belongs in hacs.json), and a requirement must not contain a space.

Commits

  1. test: patch async_setup_entry in the config flow test.
  2. fix: lint findings (E4/E7/E9/F): two bare except: (they also caught CancelledError) become except Exception:, an identical duplicate device_info property removed, an unused import, two unused locals, six pointless f-prefixes.
  3. build: depend on pyaltherma pinned to v0.1.0, plugin floor 0.13.372, homeassistant: 2026.10.0 in hacs.json.
  4. chore: ruff.toml (E4/E7/E9/F) and .pre-commit-config.yaml, same as the other repositories.
  5. style: ruff format. The Python ASTs of all 11 changed files are identical before and after.
  6. ci: ci.yml and security.yml on the shared workflow-basics actions.
  7. fix (manifest): drop the invalid homeassistant key, pyaltherma@git+https://...@v0.1.0 without spaces, and point codeowners (@timstoop), documentation and issue_tracker at this repository instead of the upstream author. This commit also deletes .github/workflows/hassfest.yml and validate.yml: they were staged together by mistake, and the history was already pushed.
  8. ci: .forgejo/workflows/hassfest.yml using the shared hassfest action.

Merge order

  1. tim/pyaltherma!1: merged, v0.1.0 exists.
  2. tim/workflow-basics!5 (the hassfest action) must be merged before the hassfest check can pass here; until then it fails with "action not found".
  3. This MR.

Verified (Python 3.14.8, Home Assistant 2026.10.1, pyaltherma 0.1.0)

  • 7 tests pass; ruff check, ruff format --check and bandit -ll clean.
  • hassfest: Invalid integrations: 0.
  • The tests cover only the config flow and setup; the entities are not covered. Not tested against a real heat pump.

Not included

  • The HACS validation action (hacs/action) needs the GitHub API and has no Forgejo equivalent. hassfest plus a correct hacs.json is what can be checked.
  • pip-audit is off in security.yml: the test requirements are the whole Home Assistant test environment, not what ships.

Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98

🤖 Generated with Claude Code

Maintenance run. Nine commits. ## Findings - **The test requirements were two years stale**: `pytest-homeassistant-custom-component==0.13.316` pinned an old Home Assistant. With the plugin floor at 0.13.372 the suite runs against **Home Assistant 2026.10.1 on Python 3.14**. - That exposed **one failing test**: after the config flow created the entry, Home Assistant set it up, and setup used the real `DaikinWSConnection` (only the config flow's classes were patched), so it dialled 192.168.1.50 and the plugin blocked the socket. The test now patches `async_setup_entry`. - `pyaltherma` (the runtime dependency) has been idle since February 2023 (last release 0.0.21, 7 open issues). It is forked as **tim/pyaltherma** and released as 0.1.0 (tim/pyaltherma!1, merged, tag `v0.1.0` exists). - **No usable CI existed**: only the upstream GitHub workflows (hassfest, HACS validation), which never run on Forgejo. - **hassfest found two real manifest errors** in my own earlier commit on this branch: `homeassistant` is not a valid manifest key (the minimum version belongs in `hacs.json`), and a requirement must not contain a space. ## Commits 1. **test**: patch `async_setup_entry` in the config flow test. 2. **fix**: lint findings (E4/E7/E9/F): two bare `except:` (they also caught `CancelledError`) become `except Exception:`, an identical duplicate `device_info` property removed, an unused import, two unused locals, six pointless f-prefixes. 3. **build**: depend on `pyaltherma` pinned to `v0.1.0`, plugin floor 0.13.372, `homeassistant: 2026.10.0` in `hacs.json`. 4. **chore**: `ruff.toml` (E4/E7/E9/F) and `.pre-commit-config.yaml`, same as the other repositories. 5. **style**: ruff format. The Python ASTs of all 11 changed files are identical before and after. 6. **ci**: `ci.yml` and `security.yml` on the shared workflow-basics actions. 7. **fix** (manifest): drop the invalid `homeassistant` key, `pyaltherma@git+https://...@v0.1.0` without spaces, and point `codeowners` (`@timstoop`), `documentation` and `issue_tracker` at this repository instead of the upstream author. **This commit also deletes `.github/workflows/hassfest.yml` and `validate.yml`**: they were staged together by mistake, and the history was already pushed. 8. **ci**: `.forgejo/workflows/hassfest.yml` using the shared `hassfest` action. ## Merge order 1. tim/pyaltherma!1: merged, `v0.1.0` exists. 2. **tim/workflow-basics!5 (the `hassfest` action)** must be merged before the hassfest check can pass here; until then it fails with "action not found". 3. This MR. ## Verified (Python 3.14.8, Home Assistant 2026.10.1, pyaltherma 0.1.0) - 7 tests pass; `ruff check`, `ruff format --check` and `bandit -ll` clean. - hassfest: `Invalid integrations: 0`. - The tests cover only the config flow and setup; the entities are not covered. Not tested against a real heat pump. ## Not included - The HACS validation action (`hacs/action`) needs the GitHub API and has no Forgejo equivalent. hassfest plus a correct `hacs.json` is what can be checked. - `pip-audit` is off in `security.yml`: the test requirements are the whole Home Assistant test environment, not what ships. Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Creating the entry also sets it up, and only the config flow's
pyaltherma classes were patched, so setup dialled 192.168.1.50 and the
Home Assistant test plugin blocked the socket (the only failing test
against current Home Assistant). Patch async_setup_entry, as the other
flow test already avoids by erroring before entry creation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
Findings of the lint rule set now enforced in CI (E4/E7/E9/F):

- __init__ and sensor: bare except also caught CancelledError and
  KeyboardInterrupt; except Exception keeps the log-and-mark-unavailable
  behaviour and lets cancellation through
- number: remove an identical second device_info property (F811)
- remove an unused import (MAX_UPDATE_FAILED), two unused locals, and
  six f-prefixes on strings without placeholders

No behaviour change otherwise.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
- pyaltherma comes from tim/pyaltherma pinned to the immutable tag
  v0.1.0 (upstream has been idle since February 2023); the tag is
  created when tim/pyaltherma!1 is merged
- manifest.json and hacs.json declare homeassistant 2026.10.0, the
  release the tests run against (it needs Python >=3.14.2); none was
  declared before
- test plugin floor pytest-homeassistant-custom-component >=0.13.372
  (was ==0.13.316): it pins homeassistant, pytest and pytest-asyncio

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
Same E4/E7/E9/F rule set as the other repositories.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
Formatting only: the Python ASTs of all 11 changed files are identical
before and after.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
ci: lint, test and security scan on the shared workflow-basics actions
Some checks failed
CI / Lint and test (pull_request) Failing after 9s
Security / Security scan (pull_request) Successful in 12s
1b5e7383a3
This repository only had the upstream GitHub workflows (hassfest and
HACS validation), which never run on Forgejo.

- ci.yml: python-test with requirements_test.txt (ruff check, ruff
  format --check, pytest against the Home Assistant the plugin pins)
- security.yml: bandit on custom_components and gitleaks over history,
  on PRs, main and weekly

Uses tim/workflow-basics @main. The test job installs pyaltherma from
the v0.1.0 tag of tim/pyaltherma, so it passes once that is tagged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
fix: make the manifest valid for hassfest and point it at this fork
Some checks failed
CI / Lint and test (pull_request) Has been cancelled
Security / Security scan (pull_request) Has been cancelled
50cff6e80f
hassfest (Home Assistant's own validator) rejected the manifest:

- "homeassistant" is not a valid manifest key; the minimum version lives
  in hacs.json, which already has it (the key was added in an earlier
  commit of this branch)
- the requirement must not contain a space: pyaltherma@git+https://...
  instead of pyaltherma @ git+https://...

Metadata now points at this repository instead of the upstream author:
codeowners @timstoop, documentation and issue_tracker on Forgejo.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
ci: validate with hassfest on Forgejo instead of the GitHub workflows
All checks were successful
CI / Lint and test (pull_request) Successful in 1m29s
Security / Security scan (pull_request) Successful in 13s
Hassfest / Validate integration (pull_request) Successful in 11s
05224c90c1
The upstream .github/workflows/hassfest.yml and validate.yml use
GitHub-only actions (home-assistant/actions/hassfest, hacs/action) and
never ran on Forgejo. Their removal is part of the previous commit (it
was staged together by mistake); this commit adds the replacement: the
shared hassfest action from workflow-basics, on PRs, main and weekly.

The HACS validation action needs the GitHub API and has no Forgejo
equivalent; hassfest plus a valid hacs.json is what can be checked here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
tim merged commit 6e5f03fd75 into main 2026-10-12 12:39:08 +00:00
tim deleted branch chore/maintenance-2026-10 2026-10-12 12:39:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tim/hass-daikin-altherma!1
No description provided.