ESPHome 2025.5.0
Loading...
Searching...
No Matches
template_binary_sensor.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome {
7namespace template_ {
8
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
Base class for all binary_sensor-type classes.
std::function< optional< bool >()> f_
void set_template(std::function< optional< bool >()> &&f)
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.cpp:18
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7