ESPHome 2026.2.4
Loading...
Searching...
No Matches
template_sensor.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::template_ {
8
9class TemplateSensor final : public sensor::Sensor, public PollingComponent {
10 public:
11 template<typename F> void set_template(F &&f) { this->f_.set(std::forward<F>(f)); }
12
13 void update() override;
14
15 void dump_config() override;
16
17 float get_setup_priority() const override;
18
19 protected:
21};
22
23} // namespace esphome::template_
ESPDEPRECATED("set_retry is deprecated and will be removed in 2026.8.0. Use set_timeout or set_interval instead.", "2026.2.0") void set_retry(const std uint32_t uint8_t std::function< RetryResult(uint8_t)> && f
Definition component.h:373
This class simplifies creating components that periodically check a state.
Definition component.h:512
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:43
float get_setup_priority() const override