6static const char *
const TAG =
"number.automation";
16 convert hash = {.from = (local_max - local_min)};
19 if (this->
rtc_.
load(&initial_state)) {
28 if (std::isnan(
state))
31 float local_min = this->
min_.
value(state);
32 float local_max = this->
max_.
value(state);
35 if (std::isnan(local_min) && std::isnan(local_max)) {
37 }
else if (std::isnan(local_min)) {
38 in_range =
state <= local_max;
39 }
else if (std::isnan(local_max)) {
40 in_range =
state >= local_min;
42 in_range = local_min <=
state &&
state <= local_max;
ESPPreferenceObject make_entity_preference(uint32_t version=0)
Create a preference object for storing this entity's state/settings.
void trigger(const Ts &...x)
void add_on_state_callback(std::function< void(float)> &&callback)
TemplatableValue< float, float > min_
void on_state_(float state)
float get_setup_priority() const override
TemplatableValue< float, float > max_
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.