Skip to content

Disable USB discovery for teleinfo#170933

Merged
balloob merged 3 commits into
home-assistant:devfrom
puddly:puddly/disable-teleinfo-discovery
May 16, 2026
Merged

Disable USB discovery for teleinfo#170933
balloob merged 3 commits into
home-assistant:devfrom
puddly:puddly/disable-teleinfo-discovery

Conversation

@puddly
Copy link
Copy Markdown
Contributor

@puddly puddly commented May 16, 2026

Proposed change

Disable USB discovery for the teleinfo integration. The current USB filters are too broad and match a lot of devices. This, coupled with a bug that causes the integration to auto-probe discovered serial ports without confirmation, causes serial issues elsewhere in Core and other addons.

I've also fixed the underlying discovery confirmation bug defensively, just in case some other codepath that I'm not aware of can trigger it.

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:

@puddly puddly added this to the 2026.5.3 milestone May 16, 2026
Copilot AI review requested due to automatic review settings May 16, 2026 22:07
@home-assistant
Copy link
Copy Markdown
Contributor

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

Code owner commands

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

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 disables USB matcher-based discovery for the teleinfo integration (to prevent overly broad VID/PID matches from triggering unwanted serial probing) and ensures serial-port validation only happens after the user confirms a USB discovery flow.

Changes:

  • Removed teleinfo USB VID/PID matchers from the integration manifest and the generated USB matcher registry.
  • Deferred Teleinfo frame-reading/validation from async_step_usb to async_step_usb_confirm so discovery no longer auto-probes ports without confirmation.
  • Updated config flow tests to cover the new “usb_confirm then abort/create” behavior.

Reviewed changes

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

File Description
tests/components/teleinfo/test_config_flow.py Adjusts USB discovery tests to go through the confirmation step before aborting/creating entries.
homeassistant/generated/usb.py Removes teleinfo entries from the generated USB matcher list to stop automatic USB discovery matching.
homeassistant/components/teleinfo/manifest.json Clears USB matcher configuration for teleinfo to disable USB discovery matching.
homeassistant/components/teleinfo/config_flow.py Moves serial port validation and unique_id logic to the confirmation step to prevent auto-probing on discovery.

Comment thread homeassistant/components/teleinfo/manifest.json
@balloob balloob merged commit 7b589d6 into home-assistant:dev May 16, 2026
33 checks passed
Copilot AI pushed a commit to AlCalzone/homeassistant-core that referenced this pull request May 17, 2026
Co-authored-by: AlCalzone <17641229+AlCalzone@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators May 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

4 participants