8000 Fix #ifdefs by clydebarrow · Pull Request #8853 · esphome/esphome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix #ifdefs #8853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged

Fix #ifdefs #8853

merged 1 commit into from
May 20, 2025

Conversation

clydebarrow
Copy link
Contributor

What does this implement/fix?

Fix compilation error due to incorrect nesting of #ifdefs.

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):

Pull request in esphome-docs with documentation (if applicable):

  • esphome/esphome-docs#

Test Environment

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

Example entry for config.yaml:

# Example config.yaml

Checklist:

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

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

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 00:14
@clydebarrow clydebarrow requested a review from OttoWinter as a code owner May 20, 2025 00:14
@probot-esphome
Copy link

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

@clydebarrow clydebarrow added this to the 2025.5.0b5 milestone May 20, 2025
@clydebarrow
Copy link
Contributor Author

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#8853
    components: [debug]
    refresh: 1h

(Added by the PR bot)

@clydebarrow clydebarrow added bugfix and removed core labels May 20, 2025
@codecov-commenter
Copy link
codecov-commenter commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.66%. Comparing base (4d8b5ed) to head (c821ebb).
Report is 2656 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8853      +/-   ##
==========================================
+ Coverage   53.70%   56.66%   +2.95%     
==========================================
  Files          50       50              
  Lines        9408     9938     +530     
  Branches     1654     1341     -313     
==========================================
+ Hits         5053     5631     +578     
+ Misses       4056     3960      -96     
- Partials      299      347      +48     

☔ 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.

Copy link
Contributor
@Copilot 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

The PR corrects the nesting of #ifdef guards so that on_shutdown() is only compiled when USE_ESP32 is defined, fixing a compilation error.

  • Moved the on_shutdown() declaration outside the USE_SENSOR guard
  • Added a dedicated USE_ESP32 block around on_shutdown()
  • Ensured matching #endif comments

@clydebarrow clydebarrow merged commit 86670c4 into esphome:dev May 20, 2025
30 checks passed
@clydebarrow clydebarrow deleted the debug branch May 20, 2025 03:26
jesserockz pushed a commit that referenced this pull request May 20, 2025
@jesserockz jesserockz mentioned this pull request May 20, 2025
@jesserockz jesserockz mentioned this pull request May 21, 2025
sa-crespo pushed a commit to sa-crespo/esphome that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BETA [debug] error: no declaration matches 'void esphome::debug::DebugComponent::on_shutdown()'
6 participants
0