Skip to content

Conversation

@puddly
Copy link
Contributor

@puddly puddly commented Sep 30, 2025

Proposed change

This PR includes a bump of universal-silabs-flasher to 0.0.34, which adds a baudrate command mode reset pattern to USF.

Currently, we do not use the hardware bootloader reset for adapters that support it. This PR enables it for the Yellow and ZBT-2 firmware flows and adds tests to ensure it is used. This makes firmware flashing succeed even if we cannot detect the firmware currently running on the adapter.

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

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

@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_connect_zbt2) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homeassistant_connect_zbt2 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_connect_zbt2 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.

@puddly puddly marked this pull request as ready for review September 30, 2025 18:40
@puddly puddly requested a review from a team as a code owner September 30, 2025 18:40
Copilot AI review requested due to automatic review settings September 30, 2025 18:40
Copy link
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 enables hardware bootloader reset methods for firmware config flows by upgrading universal-silabs-flasher to version 0.0.33 and implementing device-specific reset methods. The change allows firmware flashing to succeed even when the current firmware on the adapter cannot be detected.

Key changes:

  • Upgrades universal-silabs-flasher dependency from 0.0.32 to 0.0.33
  • Changes bootloader reset parameter from single string to sequence of strings
  • Adds specific reset methods for Yellow ("yellow") and ZBT-2 ("rts_dtr", "baudrate") devices

Reviewed Changes

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

Show a summary per file
File Description
requirements_all.txt Updates universal-silabs-flasher dependency to 0.0.33
requirements_test_all.txt Updates test dependency to match production requirement
homeassistant/components/homeassistant_hardware/manifest.json Updates manifest with new universal-silabs-flasher version
homeassistant/components/homeassistant_hardware/util.py Changes bootloader_reset parameter from string to sequence
homeassistant/components/homeassistant_hardware/update.py Updates bootloader_reset_type to bootloader_reset_methods list
homeassistant/components/homeassistant_hardware/firmware_config_flow.py Adds BOOTLOADER_RESET_METHODS class attribute and uses it in firmware installation
homeassistant/components/homeassistant_yellow/update.py Updates Yellow firmware entity to use list-based reset methods
homeassistant/components/homeassistant_yellow/config_flow.py Adds Yellow-specific bootloader reset methods constant
homeassistant/components/homeassistant_sky_connect/update.py Updates SkyConnect to use empty list instead of None for reset methods
homeassistant/components/homeassistant_connect_zbt2/update.py Adds ZBT-2 specific reset methods (rts_dtr, baudrate)
homeassistant/components/homeassistant_connect_zbt2/config_flow.py Adds ZBT-2 bootloader reset methods with explanation comment
tests/ Updates all test files to use new sequence-based bootloader reset API and adds verification tests

@MartinHjelmare
Copy link
Member

There are merge conflicts now.

return FlasherApplicationType(self.value)


class ResetTarget(StrEnum):
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we use the library ResetTarget enum directly?

Copy link
Member

Choose a reason for hiding this comment

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

Please address this as a follow up if needed.

@MartinHjelmare MartinHjelmare merged commit 77c8426 into home-assistant:dev Oct 1, 2025
48 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2025
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.

4 participants