8000
Skip to content

[const] Move CONF_SCAN_PARAMETERS and CONF_WINDOW to components/const - #17900

Merged
bdraco merged 1 commit into
esphome:devfrom
Bl00d-B0b:ble-scan-consts
Jul 28, 2026
Merged

[const] Move CONF_SCAN_PARAMETERS and CONF_WINDOW to components/const#17900
bdraco merged 1 commit into
esphome:devfrom
Bl00d-B0b:ble-scan-consts

Conversation

@Bl00d-B0b
Copy link
Copy Markdown
Contributor

What does this implement/fix?

Moves CONF_SCAN_PARAMETERS and CONF_WINDOW into esphome/components/const/__init__.py, and switches their two current definers (esp32_ble_tracker, bk72xx_ble_tracker) to import them from there.

Both constants are now defined in two components, and the in-flight LN882H tracker (#16691) needs the same names — a third definition trips the ci-custom duplicate-constant lint, whose prescribed remedy is exactly this move in a separate PR.

The names remain importable from esp32_ble_tracker (the from … import keeps them in the module namespace), so any external consumer is unaffected.

Verified: script/ci-custom.py output is identical to a clean dev checkout (the duplicate-constant lint no longer fires, nothing new appears), ruff check/format clean, and both the esp32 and BK72xx tracker configs still validate.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New developer-facing feature (adds functionality for component developers; no end-user configuration change)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — policy
  • Developer breaking change (an API change that could break external components) — policy
  • Undocumented C++ API change (removal or change of undocumented public methods that lambda users may depend on) — policy
  • Code quality improvements to existing code or addition of tests
  • Other

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040/RP2350
  • BK72xx
  • RTL87xx
  • LN882x
  • nRF52840

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

@Bl00d-B0b
Bl00d-B0b requested review from a team and bdraco as code owners July 28, 2026 05:50
@esphome
esphome Bot commented Jul 28, 2026
Copy link
Copy Markdown
Contributor

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

@bdraco, @esphome/core - 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.

@esphome
esphome Bot commented Jul 28, 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#17900
    components: [bk72xx_ble_tracker, const, esp32_ble_tracker]
    refresh: 1h

(Added by the PR bot)

@codecov
codecov Bot commented Jul 28, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.60%. Comparing base (93eec5c) to head (e165aa9).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #17900   +/-   ##
=======================================
  Coverage   86.60%   86.60%           
=======================================
  Files          60       60           
  Lines       14217    14217           
  Branches     2147     2147           
=======================================
  Hits        12312    12312           
  Misses       1594     1594           
  Partials      311      311           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

Memory Impact Analysis

Components: esp32_ble_tracker
Platform: esp32-idf

Metric Target Branch This PR Change
RAM 66,376 bytes 66,376 bytes ➡️ +0 bytes (0.00%)
Flash 1,071,019 bytes 1,071,019 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.

@Bl00d-B0b
Bl00d-B0b requested a review from bdraco July 28, 2026 06:36
@bdraco
bdraco commented Jul 28, 2026
Copy link
Copy Markdown
Member

Thanks @Bl00d-B0b

@bdraco
bdraco merged commit bb8ffac into esphome:dev Jul 28, 2026
45 of 46 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2026
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.

2 participants

0