1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-15 23:30:28 +01:00
Kevin Ahrendt 6f4e8f1fbf
[mixer] Media Player Components PR8 (#8170)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-04 23:00:02 +00:00

20 lines
503 B
C++

#pragma once
#include "mixer_speaker.h"
#ifdef USE_ESP32
namespace esphome {
namespace mixer_speaker {
template<typename... Ts> class DuckingApplyAction : public Action<Ts...>, public Parented<SourceSpeaker> {
TEMPLATABLE_VALUE(uint8_t, decibel_reduction)
TEMPLATABLE_VALUE(uint32_t, duration)
void play(Ts... x) override {
this->parent_->apply_ducking(this->decibel_reduction_.value(x...), this->duration_.value(x...));
}
};
} // namespace mixer_speaker
} // namespace esphome
#endif