Skip to content

feat!: require Home Assistant 2026.11 and test with core's pytest-homeassistant - #1856

Merged
raman325 merged 1 commit into
mainfrom
build/pytest-homeassistant
Nov 26, 2026
Merged

raman325 merged 1 commit into
mainfrom
build/pytest-homeassistant

Conversation

@raman325

Copy link
Copy Markdown
Owner

Breaking change

Lock Code Manager now requires Home Assistant 2026.11.0 or newer. HACS will not offer this release to installations on an older core. Nothing changes in how you configure or use the integration. Home Assistant 2026.11 changed how integrations report a successful setup, and 2026.10 rejects the new form, so one release can't support both.

Proposed change

This replaces #1844, which can never pass: it raises homeassistant to 2026.11.2 but keeps pytest-homeassistant-custom-component 0.13.375, which pins homeassistant==2026.10.4 exactly, so the dependency install fails before any test runs.

1. Test package: phacc → core's pytest-homeassistant

phacc is deprecated (2026-11-03) and will not release again. Its replacement is published from home-assistant/core's packages/pytest-homeassistant, versioned with Home Assistant.

  • requirements_test.txt: pytest-homeassistant==2026.11.3.
  • Imports move from pytest_homeassistant_custom_component.* to pytest_homeassistant.* (74 test files, no other change in them). The plugin loads through its entry point, so pytest_plugins is gone.
  • phacc carried all of core's test requirements. The new package doesn't, so the integrations the tests load need their manifest requirements declared here: aiohasupervisor (hassio), numpy, av, PyTurboJPEG (Matter now imports camera → stream), and SQLAlchemy, fnv-hash-fast, psutil-home-assistant (recorder). Versions mirror the 2026.11.3 manifests and join the Dependabot homeassistant group.
  • hass_config_dir is overridden to hass_tmp_config_dir, as the package's README recommends. Without it the package shares tests/testing_config, and Home Assistant wrote its default blueprints into the repository on every run.
  • zha/zha-quirks move to 2.4.3/2.4.1 to match 2026.11.3. build(deps-dev): bump the homeassistant group across 1 directory with 6 updates #1844's matter-python-client 1.6.0, zwave-js-server-python 0.75.0 and aioesphomeapi 46.30.1 are ahead of what 2026.11.3's manifests pin, so they're left out.

2. Config entry methods return None (the floor bump)

2026.11 changed async_setup_entry, async_migrate_entry and async_unload_entry to return None and raise on failure (architecture#1463). A returned bool is reported, and the report raises under test, so 916 tests errored. 2026.10 instead fails setup when async_setup_entry returns None (did not return boolean), hence hacs.json → 2026.11.0.

A failed platform unload now raises ConfigEntryError with Home Assistant's own unload_platforms_failed translation. It is raised after the strategy resource cleanup, not through async_unload_platforms_or_raise, so that cleanup still runs when a platform fails to unload, as before.

3. Deleted user: the card got an all-empty payload first

2026.11 moved the registry cleanup for a removed subentry into _async_update_entry, ahead of _async_save_and_notify. In 2026.10 it ran after the entry was saved and its update listener scheduled. So the user's entities now disappear while runtime_data.config still lists their slot, and subscribe_code_slot sent the all-null payload (name: "", every entity None) it was written to avoid, before the removed event. The existing tests test_subscribe_code_slot_says_so_when_the_user_is_deleted and ..._ends_when_the_subentry_is_removed caught it. The check now reads the entry's subentries, which are updated before the registries.

4. Smaller 2026.11 fallout

  • CONN_CLASS_* is deprecated with no replacement, and Home Assistant doesn't read CONNECTION_CLASS, so the config flow drops it.
  • The deprecation detector's format guard failed as designed: 2026.11 reworded the messages. The formats are updated, and with them the detector found the CONN_CLASS_LOCAL_POLL use above.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

🤖 Generated with Claude Code

…eassistant

pytest-homeassistant-custom-component is deprecated and frozen at Home
Assistant 2026.10.4, so no 2026.11 bump could resolve against it. Tests now
use core's pytest-homeassistant, pinned to the Home Assistant version under
test, with the integration requirements it no longer brings in.

Home Assistant 2026.11 changes the config entry contract: setup, migrate and
unload return None and raise on failure, and 2026.10 rejects None, so the
minimum version moves to 2026.11.0. It also removes a deleted subentry's
entities before notifying the entry, which made a code slot subscription send
an all-empty payload for a deleted user; the removal check now reads the
entry's subentries. CONN_CLASS_* is deprecated with no replacement and is
dropped, and the deprecation detector follows Home Assistant's reworded
messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: f9618439d905
Copilot AI balanced review requested due to automatic review settings November 26, 2026 19:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code documentation Documentation changes github-config Changes to .github/ configuration files breaking-change Pull requests that break existing functionality labels Nov 26, 2026
@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.89%. Comparing base (331ef7a) to head (f0297e2).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1856      +/-   ##
==========================================
- Coverage   98.89%   98.89%   -0.01%     
==========================================
  Files          73       73              
  Lines       10360    10358       -2     
  Branches      599      599              
==========================================
- Hits        10246    10244       -2     
  Misses        114      114              
Flag Coverage Δ
python 99.41% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
custom_components/lock_code_manager/__init__.py 100.00% <100.00%> (ø)
custom_components/lock_code_manager/config_flow.py 100.00% <ø> (ø)
custom_components/lock_code_manager/websocket.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@raman325
raman325 merged commit dd62a8b into main Nov 26, 2026
18 checks passed
@raman325
raman325 deleted the build/pytest-homeassistant branch November 26, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Pull requests that break existing functionality dependencies Pull requests that update a dependency file documentation Documentation changes github-config Changes to .github/ configuration files python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants