22 void play(Ts...
x)
override {
23 auto call = this->number_->make_call();
24 call.set_value(this->value_.value(
x...));
36 TEMPLATABLE_VALUE(
bool, cycle)
38 void play(Ts...
x)
override {
39 auto call = this->number_->make_call();
40 call.with_operation(this->operation_.value(x...));
41 if (this->cycle_.has_value()) {
42 call.with_cycle(this->cycle_.value(x...));
55 template<
typename V>
void set_min(V min) { this->min_ = min; }
56 template<
typename V>
void set_max(V max) { this->max_ = max; }
58 void setup()
override;
59 float get_setup_priority()
const override;
62 void on_state_(
float state);
66 bool previous_in_range_{
false};
75 void set_min(
float min) { this->min_ = min; }
76 void set_max(
float max) { this->max_ = max; }
78 const float state = this->parent_->state;
79 if (std::isnan(this->min_)) {
80 return state <= this->max_;
81 }
else if (std::isnan(this->max_)) {
82 return state >= this->min_;
84 return this->min_ <= state && state <= this->max_;
NumberOperationAction(Number *number)
void add_on_state_callback(std::function< void(float)> &&callback)
TEMPLATABLE_VALUE(float, value) void play(Ts... x) override
bool check(Ts... x) override
ValueRangeTrigger(Number *parent)
void trigger(Ts... x)
Inform the parent automation that the event has triggered.
Base class for all automation conditions.
Base-class for all numbers.
NumberStateTrigger(Number *parent)
Implementation of SPI Controller mode.
NumberSetAction(Number *number)
NumberInRangeCondition(Number *parent)