Skip to content

Allow setup of Zigbee/Thread for ZBT-1 and Yellow without internet access #147549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Jun 26, 2025

Proposed change

#145019 removed Core's dependency on firmware flashing addons to manage firmware versions. This PR allows for adapter setup to succeed without internet access by avoiding upgrading firmwares where it is not technically necessary (but still recommended):

  1. The adapter is running the correct firmware type but the latest (or newer) version.
  2. Internet access is down and the adapter is running out-of-date but still valid firmware.
  3. The firmware update index is inaccessible for whatever reason.

All other scenarios (migrating between Zigbee and Thread, for example) will still require internet access for addon setup and downloading the correct firmware.

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • 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.

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 link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (homeassistant_yellow) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homeassistant_yellow can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign homeassistant_yellow Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (homeassistant_sky_connect) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homeassistant_sky_connect can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign homeassistant_sky_connect Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (homeassistant_hardware) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homeassistant_hardware can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign homeassistant_hardware Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@@ -215,6 +280,14 @@ async def async_step_addon_operation_failed(
},
)

async def async_step_pre_confirm_zigbee(
Copy link
Member

Choose a reason for hiding this comment

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

This seems odd, how do other integrations do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't a pattern I've seen elsewhere but I really have no idea how else to do it, user_input is passed to the step referenced in return self.async_show_progress_done(next_step_id=next_step_id) and it skips the final confirmation step otherwise.

@frenck
Copy link
Member

frenck commented Jun 26, 2025

I've marked this PR in draft, as changes are requested that need to be processed.
Please un-draft it once it is ready for review again by clicking the "Ready for review" button.

Thanks! 👍

../Frenck

@frenck frenck marked this pull request as draft June 26, 2025 08:51
@frenck frenck marked this pull request as draft June 26, 2025 08:51
@puddly puddly marked this pull request as ready for review June 26, 2025 18:29
@puddly
Copy link
Contributor Author

puddly commented Jun 26, 2025

I've addressed the broad exception review comments. Regarding the async_step_pre_confirm_zigbee and async_step_confirm_zigbee steps, I think this may be a bug in Core (or likely elsewhere in the hardware config flow), not necessarily related to this PR.

@frenck frenck requested a review from Copilot June 26, 2025 18:48
Copy link
Contributor

@Copilot 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 enhances the firmware configuration flow to allow Zigbee/Thread adapters to be set up without internet access when an update is not strictly required, and adds robust handling and tests for download failures.

  • Skip firmware update steps if the device already has correct or newer firmware, or if download fails but update isn’t required
  • Introduce pre_confirm_zigbee/pre_confirm_otbr intermediary steps and update related config flows and tests
  • Add new fw_download_failed abort reason with user-facing strings and cover it in tests for both required and optional update scenarios

Reviewed Changes

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

Show a summary per file
File Description
tests/components/homeassistant_yellow/test_config_flow.py Updated tests to use pre_confirm_ steps and split confirm/create
tests/components/homeassistant_sky_connect/test_config_flow.py Mirrored pre-confirm updates and result restructuring in tests
tests/components/homeassistant_hardware/test_config_flow_failures.py Added tests for index/image download failures and imported ClientError
tests/components/homeassistant_hardware/test_config_flow.py Added scenarios for failed downloads, downgrade guard, and imports
homeassistant/components/homeassistant_yellow/strings.json Added fw_download_failed translation key
homeassistant/components/homeassistant_sky_connect/strings.json Added fw_download_failed translation key
homeassistant/components/homeassistant_sky_connect/config_flow.py Changed Zigbee next step to pre_confirm_zigbee
homeassistant/components/homeassistant_hardware/strings.json Added fw_download_failed translation key
homeassistant/components/homeassistant_hardware/firmware_config_flow.py Skip or abort on download failures only when strictly required; add pre-confirm steps
Comments suppressed due to low confidence (1)

homeassistant/components/homeassistant_hardware/firmware_config_flow.py:11

  • Remove the duplicate import of FirmwareUpdateClient and combine it with the subsequent import of ManifestMissing to clean up redundant imports.
from ha_silabs_firmware_client import FirmwareUpdateClient, ManifestMissing

Co-authored-by: Norbert Rittel <norbert@rittel.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants