ESPHome  2024.10.2
template_binary_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace esphome {
7 namespace 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
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
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base class for all binary_sensor-type classes.
Definition: binary_sensor.h:37