[microphone] Use the apply helpers for the capture, mute and condition automations (#19619)

This commit is contained in:
J. Nick Koston
2026-09-25 11:04:14 -04:00
committed by GitHub
parent 45bcff2c2c
commit db566b25d0
4 changed files with 37 additions and 83 deletions
@@ -0,0 +1,12 @@
# capture, stop_capture and is_capturing on the external microphone.
button:
- platform: template
name: Microphone Capture
on_press:
- if:
condition:
microphone.is_capturing: mic_id_external
then:
- microphone.stop_capture: mic_id_external
else:
- microphone.capture: mic_id_external
@@ -0,0 +1,8 @@
substitutions:
i2s_din_pin1: GPIO33
i2s_din_pin2: GPIO34
packages:
i2s_audio: !include ../../test_build_components/common/i2s_audio/esp32-idf.yaml
microphone: !include common-pdm.yaml
actions: !include common-actions.yaml