ESPHome  2024.4.1
number_traits.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/helpers.h"
5 
6 namespace esphome {
7 namespace number {
8 
9 enum NumberMode : uint8_t {
13 };
14 
16  public:
17  // Set/get the number value boundaries.
18  void set_min_value(float min_value) { min_value_ = min_value; }
19  float get_min_value() const { return min_value_; }
20  void set_max_value(float max_value) { max_value_ = max_value; }
21  float get_max_value() const { return max_value_; }
22 
23  // Set/get the step size for incrementing or decrementing the number value.
24  void set_step(float step) { step_ = step; }
25  float get_step() const { return step_; }
26 
27  // Set/get the frontend mode.
28  void set_mode(NumberMode mode) { this->mode_ = mode; }
29  NumberMode get_mode() const { return this->mode_; }
30 
31  protected:
32  float min_value_ = NAN;
33  float max_value_ = NAN;
34  float step_ = NAN;
36 };
37 
38 } // namespace number
39 } // namespace esphome
void set_min_value(float min_value)
Definition: number_traits.h:18
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:151
void set_max_value(float max_value)
Definition: number_traits.h:20
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
NumberMode get_mode() const
Definition: number_traits.h:29
void set_mode(NumberMode mode)
Definition: number_traits.h:28