8000
Skip to content

[cc1101] Export CC1101Listener to Python - #17576

Merged
swoboda1337 merged 1 commit into
esphome:devfrom
hn:add-cc1101-listener-python-export
Jul 15, 2026
Merged

[cc1101] Export CC1101Listener to Python#17576
swoboda1337 merged 1 commit into
esphome:devfrom
hn:add-cc1101-listener-python-export

Conversation

@hn
@hn hn commented Jul 15, 2026
Copy link
Copy Markdown
Contributor

What does this implement/fix?

The C++ CC1101Listener class and CC1101Component::register_listener() already exist and are used
internally, but the Python side never bound the class. External components that want to register
themselves as a packet listener from their own __init__.py (e.g. to type a cv.use_id() against it,
or declare a field of that type) currently have no way to reference cc1101.CC1101Listener from Python
without duplicating the class declaration. This adds the one missing binding line, matching the existing
CC1101Component = ns.class_(...) pattern right above it.

No C++ changes, no behavior changes, no new YAML options.

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)
  • Other

Related issue or feature (if applicable): -

Pull request in esphome-docs with documentation (if applicable): not applicable, no user-facing configuration change.

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# No YAML change. This only makes cc1101.CC1101Listener importable from another
# component's Python code, e.g.:
#   from esphome.components import cc1101
#   MyListener = ns.class_("MyListener", cc1101.CC1101Listener)

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder). (a one-line Python binding with no new runtime behavior; nothing new to assert)

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

  • Documentation added/updated in esphome-docs. (not applicable, no user-facing change)

The C++ CC1101Listener class and CC1101Component::register_listener()
already exist and are usable from other C++ components, but the Python
side never bound the class, so external/other components could not
reference cc1101.CC1101Listener from their own __init__.py (e.g. to
type a config validator or use_id against it) without their own
private copy of the class declaration.

One-line addition, no behavior change.
@esphome
esphome Bot commented Jul 15, 2026
Copy link
Copy Markdown
Contributor

To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file:

external_components:
  - source: github://pr#17576
    components: [cc1101]
    refresh: 1h

(Added by the PR bot)

@esphome
esphome Bot commented Jul 15, 2026
Copy link
Copy Markdown
Contributor

👋 Hi there! This PR modifies 1 file(s) with codeowners.

@gabest11, @lygris - As codeowner(s) of the affected files, your review would be appreciated! 🙏

Note: Automatic review request may have failed, but you're still welcome to review.

@github-actions
Copy link
Copy Markdown
Contributor

Memory Impact Analysis

Components: cc1101
Platform: esp32-idf

Metric Target Branch This PR Change
RAM 24,212 bytes 24,212 bytes ➡️ +0 bytes (0.00%)
Flash 236,515 bytes 236,515 bytes ➡️ +0 bytes (0.00%)

Note: This analysis measures static RAM and Flash usage only (compile-time allocation).
Dynamic memory (heap) cannot be measured automatically.
⚠️ You must test this PR on a real device to measure free heap and ensure no runtime memory issues.

This analysis runs automatically when components change. Memory usage is measured from a representative test configuration.

@swoboda1337
swoboda1337 merged commit 54987d7 into esphome:dev Jul 15, 2026
45 of 50 checks passed
@swoboda1337
Copy link
Copy Markdown
Member

Thanks

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
66C4

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0