mirror of
https://github.com/esphome/esphome.git
synced 2025-03-24 19:48:17 +00:00
Co-authored-by: FreeBear <freebear@tuxcnc.org> Co-authored-by: FreeBear-nc <67865163+FreeBear-nc@users.noreply.github.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
32 lines
967 B
C++
32 lines
967 B
C++
#pragma once
|
|
|
|
#include "esphome/components/number/number.h"
|
|
#include "esphome/core/preferences.h"
|
|
#include "esphome/core/log.h"
|
|
#include "esphome/components/opentherm/input.h"
|
|
|
|
namespace esphome {
|
|
namespace opentherm {
|
|
|
|
// Just a simple number, which stores the number
|
|
class OpenthermNumber : public number::Number, public Component, public OpenthermInput {
|
|
protected:
|
|
void control(float value) override;
|
|
void setup() override;
|
|
void dump_config() override;
|
|
|
|
float initial_value_{NAN};
|
|
bool restore_value_{false};
|
|
|
|
ESPPreferenceObject pref_;
|
|
|
|
public:
|
|
void set_min_value(float min_value) override { this->traits.set_min_value(min_value); }
|
|
void set_max_value(float max_value) override { this->traits.set_max_value(max_value); }
|
|
void set_initial_value(float initial_value) { initial_value_ = initial_value; }
|
|
void set_restore_value(bool restore_value) { this->restore_value_ = restore_value; }
|
|
};
|
|
|
|
} // namespace opentherm
|
|
} // namespace esphome
|