ESPHome  2024.12.2
output.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include "esphome/core/log.h"
6 
7 namespace esphome {
8 namespace opentherm {
9 
11  protected:
12  bool has_state_ = false;
13  const char *id_ = nullptr;
14 
16 
17  public:
18  float state;
19 
20  void set_id(const char *id) { this->id_ = id; }
21 
22  void write_state(float state) override;
23 
24  bool has_state() { return this->has_state_; };
25 
26  void set_min_value(float min_value) override { this->min_value_ = min_value; }
27  void set_max_value(float max_value) override { this->max_value_ = max_value; }
28  float get_min_value() { return this->min_value_; }
29  float get_max_value() { return this->max_value_; }
30 };
31 
32 } // namespace opentherm
33 } // namespace esphome
Base class for all output components that can output a variable level, like PWM.
Definition: float_output.h:31
T id(T value)
Helper function to make id(var) known from lambdas work in custom components.
Definition: helpers.h:728
void write_state(float state) override
Definition: output.cpp:9
void set_id(const char *id)
Definition: output.h:20
void set_min_value(float min_value) override
Definition: output.h:26
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void set_max_value(float max_value) override
Definition: output.h:27