mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 03:12:20 +01:00
[sound_level] Add a new sound level sensor (#8737)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
26
tests/components/sound_level/common.yaml
Normal file
26
tests/components/sound_level/common.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
i2s_audio:
|
||||
i2s_lrclk_pin: ${i2s_bclk_pin}
|
||||
i2s_bclk_pin: ${i2s_lrclk_pin}
|
||||
|
||||
microphone:
|
||||
- platform: i2s_audio
|
||||
id: i2s_microphone
|
||||
i2s_din_pin: ${i2s_dout_pin}
|
||||
adc_type: external
|
||||
bits_per_sample: 16bit
|
||||
|
||||
sensor:
|
||||
- platform: sound_level
|
||||
microphone: i2s_microphone
|
||||
measurement_duration: 2000ms
|
||||
passive: false
|
||||
peak:
|
||||
name: "Peak Sound Level"
|
||||
on_value_range:
|
||||
- above: -1.0
|
||||
then:
|
||||
- sound_level.stop:
|
||||
- delay: 5s
|
||||
- sound_level.start:
|
||||
rms:
|
||||
name: "RMS Sound Level"
|
6
tests/components/sound_level/test.esp32-ard.yaml
Normal file
6
tests/components/sound_level/test.esp32-ard.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
substitutions:
|
||||
i2s_bclk_pin: GPIO25
|
||||
i2s_lrclk_pin: GPIO26
|
||||
i2s_dout_pin: GPIO27
|
||||
|
||||
<<: !include common.yaml
|
6
tests/components/sound_level/test.esp32-c3-ard.yaml
Normal file
6
tests/components/sound_level/test.esp32-c3-ard.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
substitutions:
|
||||
i2s_bclk_pin: GPIO6
|
||||
i2s_lrclk_pin: GPIO7
|
||||
i2s_dout_pin: GPIO8
|
||||
|
||||
<<: !include common.yaml
|
6
tests/components/sound_level/test.esp32-c3-idf.yaml
Normal file
6
tests/components/sound_level/test.esp32-c3-idf.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
substitutions:
|
||||
i2s_bclk_pin: GPIO6
|
||||
i2s_lrclk_pin: GPIO7
|
||||
i2s_dout_pin: GPIO8
|
||||
|
||||
<<: !include common.yaml
|
6
tests/components/sound_level/test.esp32-idf.yaml
Normal file
6
tests/components/sound_level/test.esp32-idf.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
substitutions:
|
||||
i2s_bclk_pin: GPIO25
|
||||
i2s_lrclk_pin: GPIO26
|
||||
i2s_dout_pin: GPIO27
|
||||
|
||||
<<: !include common.yaml
|
6
tests/components/sound_level/test.esp32-s3-ard.yaml
Normal file
6
tests/components/sound_level/test.esp32-s3-ard.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
substitutions:
|
||||
i2s_bclk_pin: GPIO4
|
||||
i2s_lrclk_pin: GPIO5
|
||||
i2s_dout_pin: GPIO6
|
||||
|
||||
<<: !include common.yaml
|
6
tests/components/sound_level/test.esp32-s3-idf.yaml
Normal file
6
tests/components/sound_level/test.esp32-s3-idf.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
substitutions:
|
||||
i2s_bclk_pin: GPIO4
|
||||
i2s_lrclk_pin: GPIO5
|
||||
i2s_dout_pin: GPIO6
|
||||
|
||||
<<: !include common.yaml
|
Reference in New Issue
Block a user