ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
template_sensor.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace template_ {
9
10class TemplateSensor final : public sensor::Sensor, public PollingComponent {
11 public:
12 template<typename F> void set_template(F &&f) { this->f_.set(std::forward<F>(f)); }
13
14 void update() override;
15
16 void dump_config() override;
17
18 float get_setup_priority() const override;
19
20 protected:
22};
23
24} // namespace template_
25} // namespace esphome
This class simplifies creating components that periodically check a state.
Definition component.h:437
Lightweight wrapper for template platform lambdas (stateless function pointers only).
void set(optional< T >(*f)(Args...))
Set the lambda function pointer.
Base-class for all sensors.
Definition sensor.h:42
float get_setup_priority() const override
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7