Skip to content
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

Fix Microphone IsCapturingCondition #6490

Merged

Conversation

RaymiiOrg
Copy link
Contributor

@RaymiiOrg RaymiiOrg commented Apr 6, 2024

What does this implement/fix?

Microphone IsCapturingCondition is named IsCapturingActon in the components/microphone/automation.h header. Using the automation like so:

on_...
    if:
      condition:
        microphone.is_capturing: mic_id

does not work, the compilation fails:

src/main.cpp:29:13: error: 'IsCapturingCondition' in namespace 'esphome::microphone' does not name a template type
 microphone::IsCapturingCondition<> *microphone_iscapturingcondition;
             ^~~~~~~~~~~~~~~~~~~~
src/main.cpp:29:1: note: suggested alternative: 'IsCapturingActon'
 microphone::IsCapturingCondition<> *microphone_iscapturingcondition;
 ^~~~~~~~~~
 IsCapturingActon
src/main.cpp: In function 'void setup()':
src/main.cpp:287:3: error: 'microphone_iscapturingcondition' was not declared in this scope

This change renames the template to match with the correct name in the python files and documentation.

The documentation is already correct, no change needed there.

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

Test Environment

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

Checklist:

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

…ophone/automation.h header. Using the automation like so:

```
on_...
    if:
      condition:
        microphone.is_capturing: mic_id
```

does not work, the compilation fails:

```
src/main.cpp:29:13: error: 'IsCapturingCondition' in namespace 'esphome::microphone' does not name a template type
 microphone::IsCapturingCondition<> *microphone_iscapturingcondition;
             ^~~~~~~~~~~~~~~~~~~~
src/main.cpp:29:1: note: suggested alternative: 'IsCapturingActon'
 microphone::IsCapturingCondition<> *microphone_iscapturingcondition;
 ^~~~~~~~~~
 IsCapturingActon
src/main.cpp: In function 'void setup()':
src/main.cpp:287:3: error: 'microphone_iscapturingcondition' was not declared in this scope
```

This change renames the template to match with the correct name in the python files and documentation.
@probot-esphome
Copy link

probot-esphome bot commented Apr 6, 2024

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

@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.45%. Comparing base (4d8b5ed) to head (151ea87).
Report is 288 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6490      +/-   ##
==========================================
- Coverage   53.70%   53.45%   -0.26%     
==========================================
  Files          50       50              
  Lines        9408     9526     +118     
  Branches     1654     1683      +29     
==========================================
+ Hits         5053     5092      +39     
- Misses       4056     4125      +69     
- Partials      299      309      +10     

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

@RaymiiOrg RaymiiOrg changed the title Microphone IsCapturingCondition does not work Microphone IsCapturingCondition does not work (typo fix) Apr 6, 2024
Copy link
Member

@jesserockz jesserockz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, thank you.

@jesserockz jesserockz added this to the 2024.3.3 milestone Apr 7, 2024
@jesserockz jesserockz changed the title Microphone IsCapturingCondition does not work (typo fix) Fix Microphone IsCapturingCondition Apr 7, 2024
@jesserockz jesserockz merged commit 3823344 into esphome:dev Apr 7, 2024
58 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2024
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.

None yet

3 participants