ESPHome
2026.5.0b1
Loading...
Searching...
No Matches
esphome
components
mixer
speaker
automation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/automation.h
"
4
#include "
mixer_speaker.h
"
5
6
#ifdef USE_ESP32
7
8
namespace
esphome::mixer_speaker
{
9
template
<
typename
... Ts>
class
DuckingApplyAction
:
public
Action
<Ts...>,
public
Parented
<SourceSpeaker> {
10
TEMPLATABLE_VALUE(uint8_t, decibel_reduction);
11
TEMPLATABLE_VALUE(
uint32_t
,
duration
);
12
void
play(
const
Ts &...
x
)
override
{
13
this->
parent_
->apply_ducking(this->decibel_reduction_.value(
x
...), this->duration_.value(
x
...));
14
}
15
};
16
}
// namespace esphome::mixer_speaker
17
18
#endif
esphome::Action
Definition
automation.h:508
esphome::Parented
Helper class to easily give an object a parent of type T.
Definition
helpers.h:1861
esphome::Parented< SourceSpeaker >::parent_
SourceSpeaker * parent_
Definition
helpers.h:1872
esphome::mixer_speaker::DuckingApplyAction
Definition
automation.h:9
automation.h
mixer_speaker.h
duration
uint8_t duration
Definition
msa3xx.h:0
esphome::mixer_speaker
Definition
automation.h:8
uint32_t
static void uint32_t
Definition
crash_handler.cpp:141
x
uint16_t x
Definition
tt21100.cpp:5
Generated by
1.12.0