ESPHome  2024.12.2
number.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include "esphome/core/log.h"
7 
8 namespace esphome {
9 namespace opentherm {
10 
11 // Just a simple number, which stores the number
12 class OpenthermNumber : public number::Number, public Component, public OpenthermInput {
13  protected:
14  void control(float value) override;
15  void setup() override;
16  void dump_config() override;
17 
18  float initial_value_{NAN};
19  bool restore_value_{false};
20 
22 
23  public:
24  void set_min_value(float min_value) override { this->traits.set_min_value(min_value); }
25  void set_max_value(float max_value) override { this->traits.set_max_value(max_value); }
26  void set_initial_value(float initial_value) { initial_value_ = initial_value; }
27  void set_restore_value(bool restore_value) { this->restore_value_ = restore_value; }
28 };
29 
30 } // namespace opentherm
31 } // namespace esphome
void set_restore_value(bool restore_value)
Definition: number.h:27
void set_initial_value(float initial_value)
Definition: number.h:26
void set_max_value(float max_value) override
Definition: number.h:25
void set_min_value(float min_value)
Definition: number_traits.h:18
Base-class for all numbers.
Definition: number.h:39
ESPPreferenceObject pref_
Definition: number.h:21
void set_max_value(float max_value)
Definition: number_traits.h:20
NumberTraits traits
Definition: number.h:49
void control(float value) override
Definition: number.cpp:8
void set_min_value(float min_value) override
Definition: number.h:24
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7