ESPHome
2025.5.0
Loading...
Searching...
No Matches
esphome
components
template
binary_sensor
template_binary_sensor.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/binary_sensor/binary_sensor.h
"
5
6
namespace
esphome
{
7
namespace
template_ {
8
9
class
TemplateBinarySensor
:
public
Component
,
public
binary_sensor::BinarySensor
{
10
public
:
11
void
set_template
(std::function<
optional<bool>
()> &&f) { this->
f_
= f; }
12
13
void
setup
()
override
;
14
void
loop
()
override
;
15
void
dump_config
()
override
;
16
17
float
get_setup_priority
()
const override
{
return
setup_priority::HARDWARE
; }
18
19
protected
:
20
std::function<optional<bool>()>
f_
{
nullptr
};
21
};
22
23
}
// namespace template_
24
}
// namespace esphome
binary_sensor.h
esphome::Component
Definition
component.h:70
esphome::binary_sensor::BinarySensor
Base class for all binary_sensor-type classes.
Definition
binary_sensor.h:37
esphome::optional
Definition
optional.h:36
esphome::template_::TemplateBinarySensor
Definition
template_binary_sensor.h:9
esphome::template_::TemplateBinarySensor::get_setup_priority
float get_setup_priority() const override
Definition
template_binary_sensor.h:17
esphome::template_::TemplateBinarySensor::f_
std::function< optional< bool >()> f_
Definition
template_binary_sensor.h:20
esphome::template_::TemplateBinarySensor::dump_config
void dump_config() override
Definition
template_binary_sensor.cpp:28
esphome::template_::TemplateBinarySensor::loop
void loop() override
Definition
template_binary_sensor.cpp:19
esphome::template_::TemplateBinarySensor::setup
void setup() override
Definition
template_binary_sensor.cpp:9
esphome::template_::TemplateBinarySensor::set_template
void set_template(std::function< optional< bool >()> &&f)
Definition
template_binary_sensor.h:11
component.h
esphome::setup_priority::HARDWARE
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition
component.cpp:18
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
Generated by
1.12.0