Template Sensor

See Application::make_template_sensor().

API Reference

class TemplateSensor : public sensor::PollingSensorComponent

Public Functions

TemplateSensor(const std::string &name, uint32_t update_interval = 15000)
void set_template(std::function<optional<float>()> &&f)
void update()
void dump_config()
float get_setup_priority() const

priority of setup().

higher -> executed earlier

Defaults to 0.

Return
The setup priority of this component

Protected Attributes

std::function<optional<float>)> sensor::TemplateSensor::f_