ESPHome  2022.9.1
number_call.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "esphome/core/helpers.h"
4 #include "number_traits.h"
5 
6 namespace esphome {
7 namespace number {
8 
9 class Number;
10 
18 };
19 
20 class NumberCall {
21  public:
22  explicit NumberCall(Number *parent) : parent_(parent) {}
23  void perform();
24 
25  NumberCall &set_value(float value);
26  NumberCall &number_increment(bool cycle);
27  NumberCall &number_decrement(bool cycle);
30 
32  NumberCall &with_value(float value);
33  NumberCall &with_cycle(bool cycle);
34 
35  protected:
36  Number *const parent_;
39  bool cycle_;
40 };
41 
42 } // namespace number
43 } // namespace esphome
NumberCall & with_cycle(bool cycle)
Definition: number_call.cpp:34
NumberCall & with_operation(NumberOperation operation)
Definition: number_call.cpp:24
NumberCall & set_value(float value)
Definition: number_call.cpp:10
NumberOperation operation_
Definition: number_call.h:37
Base-class for all numbers.
Definition: number.h:29
NumberCall & number_decrement(bool cycle)
Definition: number_call.cpp:16
NumberCall & number_to_min()
Definition: number_call.cpp:20
NumberCall & with_value(float value)
Definition: number_call.cpp:29
Definition: a4988.cpp:4
NumberCall & number_to_max()
Definition: number_call.cpp:22
NumberCall(Number *parent)
Definition: number_call.h:22
NumberCall & number_increment(bool cycle)
Definition: number_call.cpp:12
optional< float > value_
Definition: number_call.h:38