ESPHome
2026.2.4
Loading...
Searching...
No Matches
esphome
components
template
output
template_output.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/automation.h
"
4
#include "
esphome/components/output/binary_output.h
"
5
#include "
esphome/components/output/float_output.h
"
6
7
namespace
esphome::template_
{
8
9
class
TemplateBinaryOutput
final :
public
output::BinaryOutput
{
10
public
:
11
Trigger<bool>
*
get_trigger
() {
return
&this->
trigger_
; }
12
13
protected
:
14
void
write_state
(
bool
state
)
override
{ this->
trigger_
.
trigger
(state); }
15
16
Trigger<bool>
trigger_
;
17
};
18
19
class
TemplateFloatOutput
final :
public
output::FloatOutput
{
20
public
:
21
Trigger<float>
*
get_trigger
() {
return
&this->
trigger_
; }
22
23
protected
:
24
void
write_state
(
float
state
)
override
{ this->
trigger_
.
trigger
(state); }
25
26
Trigger<float>
trigger_
;
27
};
28
29
}
// namespace esphome::template_
binary_output.h
esphome::Trigger
Definition
automation.h:276
esphome::Trigger::trigger
void trigger(const Ts &...x)
Inform the parent automation that the event has triggered.
Definition
automation.h:279
esphome::output::BinaryOutput
Definition
binary_output.h:18
esphome::output::FloatOutput
Base class for all output components that can output a variable level, like PWM.
Definition
float_output.h:31
esphome::template_::TemplateBinaryOutput
Definition
template_output.h:9
esphome::template_::TemplateBinaryOutput::write_state
void write_state(bool state) override
Definition
template_output.h:14
esphome::template_::TemplateBinaryOutput::trigger_
Trigger< bool > trigger_
Definition
template_output.h:16
esphome::template_::TemplateBinaryOutput::get_trigger
Trigger< bool > * get_trigger()
Definition
template_output.h:11
esphome::template_::TemplateFloatOutput
Definition
template_output.h:19
esphome::template_::TemplateFloatOutput::get_trigger
Trigger< float > * get_trigger()
Definition
template_output.h:21
esphome::template_::TemplateFloatOutput::write_state
void write_state(float state) override
Definition
template_output.h:24
esphome::template_::TemplateFloatOutput::trigger_
Trigger< float > trigger_
Definition
template_output.h:26
automation.h
state
bool state
Definition
fan.h:2
float_output.h
esphome::template_
Definition
template_alarm_control_panel.cpp:10
Generated by
1.12.0