Skip to content

Re-export COMPONENT_TYPE_TO_INFO from the top-level package#1765

Merged
bdraco merged 1 commit into
mainfrom
export-component-type-to-info
May 26, 2026
Merged

Re-export COMPONENT_TYPE_TO_INFO from the top-level package#1765
bdraco merged 1 commit into
mainfrom
export-component-type-to-info

Conversation

@bdraco

@bdraco bdraco commented May 26, 2026

Copy link
Copy Markdown
Member

What does this implement/fix?

COMPONENT_TYPE_TO_INFO is part of the public API; Home Assistant's esphome/entry_data.py imports it from the top-level package. PR #1749 added __all__ to model.py to stop leaking stdlib names, but COMPONENT_TYPE_TO_INFO was treated as internal and left out, so from aioesphomeapi import COMPONENT_TYPE_TO_INFO started failing in 45.3.0. This adds it back to __all__, removes it from the _NOT_EXPORTED set in the public API test, and pins it via test_representative_model_classes_stay_exported.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

  • fixes

Pull request in esphome (if applicable):

  • esphome/esphome#

Checklist:

  • The code change is tested and works locally.
  • If api.proto was modified, a linked pull request has been made to esphome with the same changes.
  • Tests have been added to verify that the new code works (under tests/ folder).

@bdraco bdraco marked this pull request as ready for review May 26, 2026 20:48
Copilot AI review requested due to automatic review settings May 26, 2026 20:48
@bdraco bdraco merged commit ddbd549 into main May 26, 2026
15 of 16 checks passed
@bdraco bdraco deleted the export-component-type-to-info branch May 26, 2026 20:49
@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7647f3f) to head (242a874).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1765   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         4183      4183           
=========================================
  Hits          4183      4183           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq

codspeed-hq Bot commented May 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 56 untouched benchmarks


Comparing export-component-type-to-info (242a874) with main (7647f3f)

Open in CodSpeed

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02ccee39-a33a-4eea-8aba-83b6a0e194a8

📥 Commits

Reviewing files that changed from the base of the PR and between 7647f3f and 242a874.

📒 Files selected for processing (2)
  • aioesphomeapi/model.py
  • tests/test_public_api.py

Walkthrough

COMPONENT_TYPE_TO_INFO is added to the public API export list in aioesphomeapi/model.py, and public API tests are updated to verify it remains accessible as a top-level package import.

Changes

Public API Export

Layer / File(s) Summary
Export COMPONENT_TYPE_TO_INFO
aioesphomeapi/model.py
COMPONENT_TYPE_TO_INFO is added to the module's __all__ list to make it publicly available via wildcard imports.
Update public API validation tests
tests/test_public_api.py
COMPONENT_TYPE_TO_INFO is removed from the _NOT_EXPORTED allowlist and added to the representative model classes verified to remain importable from the package root.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • esphome/aioesphomeapi#1749: Both PRs modify aioesphomeapi/model.py's __all__ export list to manage COMPONENT_TYPE_TO_INFO public API visibility.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch export-component-type-to-info

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bdraco bdraco removed the request for review from Copilot May 26, 2026 21:12
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant