ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
template_text_sensor.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace esphome::template_ {
9
11 public:
12 // User provided, not "= default": `new(p) TemplateTextSensor()` would zero-fill .bss that is already zero.
14 template<typename F> void set_template(F &&f) { this->f_.set(std::forward<F>(f)); }
15
16 void update() override;
17
18 float get_setup_priority() const override;
19
20 void dump_config() override;
21
22 protected:
24};
25
26} // namespace esphome::template_
This class simplifies creating components that periodically check a state.
Definition component.h:519
Lightweight wrapper for template platform lambdas (stateless function pointers only).
void set(optional< T >(*f)(Args...))
Set the lambda function pointer.