Skip to content

Sync with core 2026.11, restore boost end times and fix reload and reauth - #242

Merged
KJonline merged 3 commits into
masterfrom
Fix-service-issue
Nov 22, 2026
Merged

KJonline merged 3 commits into
masterfrom
Fix-service-issue

Conversation

@KJonline

Copy link
Copy Markdown
Contributor

Summary

Brings the component in line with Home Assistant core's hive integration as of 2026.11.2, makes 2026.11.0 the minimum supported Home Assistant version, and fixes several open issues.

Fixes and enhancements

  • Boost end time is back. A new "Boost ends" timestamp sensor for each heating zone and for hot water shows when the current boost finishes (e.g. "in 25 minutes"), and automations can trigger on it. Whether boost is on still comes from core's binary_sensor entities, so nothing is duplicated.
  • Reload no longer touches platforms that were never set up. Unload now covers only the platforms setup loaded. Reload still sets the entry up again with a fresh device list, so a newly added device type (e.g. a new light) is picked up. On HA 2026.11 this removes an "Ignored unload request" warning; before 2026.11 it aborted the reload.
  • Reauth is offered when the refresh token expires. HiveInvalidDeviceAuthentication now starts the reauth flow, as HiveReauthRequired already did, so users no longer have to delete and re-add the integration.
  • Battery sensors record long-term statistics (state_class: measurement).
  • Heating current-temperature attributes fixed. They now use the pinned library's getTargetTemperature and are skipped when either value isn't numeric.

Sync with core 2026.11.2

  • New services.py re-export. async_setup registers core's boost services itself, because core's own async_setup never runs when this component replaces the hive domain.
  • __init__.py follows core's 2026.11 API changes: async_setup_entry -> None, async_unload_platforms_or_raise, dr.AnyDeviceEntry, and the hub's MAC address in device connections.
  • config_flow.py: core's reauth error handling for is_device_registered, plus its debug logs. Our 2FA debug, device registration and options flow are kept.
  • services.yaml, icons.json and translations/en.json are refreshed. The .github/core_sync.json file records the synced core version for the new /sync-with-core skill.

Minimum Home Assistant 2026.11.0

  • hacs.json now requires Home Assistant 2026.11.0, plus a best-practice cleanup. manifest.json gains categories and connectivity.
  • Fallbacks for older Home Assistant versions are removed.
  • Tests move from the discontinued pytest-homeassistant-custom-component to pytest-homeassistant (versioned with Home Assistant, pinned at 2026.11.2). CI, the Compatibility workflow, script/setup and the docs are updated to match.

Closes

Closes #223
Closes #128
Closes #207
Closes #208
Closes #224

#235 (fixed by #239 in 2026.11.0) and #110 (state_class was already on the temperature sensors) are already resolved and will be closed separately.

Behaviour changes for users

  • New entities: sensor.<zone>_heating_boost_ends and sensor.<name>_hotwater_boost_ends.
  • Home Assistant 2026.11.0 or newer is now required.

Upstream

The reload, reauth and battery state_class fixes would also help core's hive integration (home-assistant/core).

Test plan

🤖 Generated with Claude Code

KJonline and others added 3 commits November 21, 2026 21:24
Update the compatibility workflow to use Home Assistant’s pytest-homeassistant package, whose version matches the HA release, and update resolver outputs and maintenance guidance accordingly.

Sync the Hive integration with newer core APIs, including service setup, config-entry lifecycle methods, device registry connections, and config-flow typing and error handling. Document related-repository guidance, the minimum supported HA version
Use the current device list to unload only platforms set up for the entry, avoiding reload warnings while picking up newly reported device types. Mark battery sensors as measurements to enable long-term statistics, and add reload and sensor coverage.
When the refresh token expires and this Home Assistant isn't registered
for Hive device login, pyhive raises HiveInvalidDeviceAuthentication.
Setup only caught HiveReauthRequired, so the entry failed without
offering reauth and users had to delete and re-add the integration.
Treat both as ConfigEntryAuthFailed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KJonline
KJonline marked this pull request as ready for review November 22, 2026 00:11
@KJonline
KJonline merged commit 17607e9 into master Nov 22, 2026
5 checks passed
@KJonline
KJonline deleted the Fix-service-issue branch November 22, 2026 00:11
KJonline added a commit that referenced this pull request Nov 22, 2026
Merge master into dev: bring #242 to the pyhive 2.0 beta line
nsleigh added a commit to nsleigh/Hive-Custom-Component that referenced this pull request Nov 22, 2026
Brings in Pyhass#242 (core 2026.11 sync, boost-ends
sensors, unload only configured platforms, reauth on
HiveInvalidDeviceAuthentication, battery state_class) while keeping the
vendored apyhiveapi, holiday mode and cold-boot retry.

- __init__.py: use upstream's services.py re-export and
  _platforms_with_devices; keep HiveUnknownConfiguration/HiveConnectionError
  -> ConfigEntryNotReady (now as messages, no _LOGGER) and holiday services.
- sensor.py: add HiveBoostEndSensorEntity using the vendored snake_case
  getters (get_boost_status/get_boost_time/get_boost,
  get_target_temperature); keep holiday sensors.
- manifest.json: keep vendored requirements/loggers/version.
- icons.json: upstream plus holiday service icons.
- translations/en.json: regenerated from strings.json (adds holiday services).
- tests: mock the vendored snake_case getters and exceptions; no hub id by
  default so holiday sensors stay out of upstream's sensor tests.
  92 passed on pytest-homeassistant 2026.11.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant