Skip to content

Migrate Thermo Beacon to config entry runtime data#170226

Merged
zweckj merged 2 commits into
devfrom
thermobeacon/migrate-to-runtime_data
May 10, 2026
Merged

Migrate Thermo Beacon to config entry runtime data#170226
zweckj merged 2 commits into
devfrom
thermobeacon/migrate-to-runtime_data

Conversation

@mib1185
Copy link
Copy Markdown
Member

@mib1185 mib1185 commented May 9, 2026

Proposed change

SSIA.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@mib1185 mib1185 requested a review from bdraco as a code owner May 9, 2026 19:27
Copilot AI review requested due to automatic review settings May 9, 2026 19:27
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented May 9, 2026

Hey there @bdraco, mind taking a look at this pull request as it has been labeled with an integration (thermobeacon) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of thermobeacon can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign thermobeacon Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

@mib1185 mib1185 force-pushed the thermobeacon/migrate-to-runtime_data branch from b7a4930 to c9cb96a Compare May 9, 2026 19:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to migrate the thermobeacon integration away from the legacy hass.data[DOMAIN] runtime storage pattern to typed ConfigEntry.runtime_data, aligning with current Home Assistant integration patterns.

Changes:

  • Introduces a typed ThermoBeaconConfigEntry alias to enable typed entry.runtime_data.
  • Updates the integration and sensor platform setup to accept the typed config entry.
  • Switches the sensor platform to read the coordinator from entry.runtime_data instead of hass.data.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
homeassistant/components/thermobeacon/__init__.py Sets entry.runtime_data during entry setup and updates function signatures to the typed config entry.
homeassistant/components/thermobeacon/sensor.py Uses entry.runtime_data to obtain the coordinator during platform setup.
homeassistant/components/thermobeacon/model.py Adds the typed ThermoBeaconConfigEntry alias for runtime data typing.
Comments suppressed due to low confidence (1)

homeassistant/components/thermobeacon/init.py:49

  • Avoid leaking per-entry coordinator objects: async_unload_entry no longer removes the entry from hass.data even though async_setup_entry stores it there. Either remove the hass.data storage entirely and rely on entry.runtime_data, or restore the hass.data cleanup when unload_platforms succeeds.
    """Unload a config entry."""
    return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

Comment thread homeassistant/components/thermobeacon/__init__.py
Comment thread homeassistant/components/thermobeacon/model.py Outdated
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft May 10, 2026 06:10
@mib1185 mib1185 marked this pull request as ready for review May 10, 2026 09:59
Copilot AI review requested due to automatic review settings May 10, 2026 09:59
@home-assistant home-assistant Bot requested a review from zweckj May 10, 2026 09:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@zweckj zweckj merged commit 62d9586 into dev May 10, 2026
37 checks passed
@zweckj zweckj deleted the thermobeacon/migrate-to-runtime_data branch May 10, 2026 14:46
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate thermobeacon to use entry.runtime_data

4 participants