mirror of
https://github.com/esphome/esphome.git
synced 2025-10-08 12:53:45 +01:00
number
This commit is contained in:
@@ -74,20 +74,20 @@ void NumberCall::perform() {
|
|||||||
target_value = this->value_.value();
|
target_value = this->value_.value();
|
||||||
} else if (this->operation_ == NUMBER_OP_TO_MIN) {
|
} else if (this->operation_ == NUMBER_OP_TO_MIN) {
|
||||||
if (std::isnan(min_value)) {
|
if (std::isnan(min_value)) {
|
||||||
this->log_perform_warning_two_strings_(LOG_STR("min"), LOG_STR("value undefined"));
|
this->log_perform_warning_two_strings_(LOG_STR("min"), LOG_STR("undefined"));
|
||||||
} else {
|
} else {
|
||||||
target_value = min_value;
|
target_value = min_value;
|
||||||
}
|
}
|
||||||
} else if (this->operation_ == NUMBER_OP_TO_MAX) {
|
} else if (this->operation_ == NUMBER_OP_TO_MAX) {
|
||||||
if (std::isnan(max_value)) {
|
if (std::isnan(max_value)) {
|
||||||
this->log_perform_warning_two_strings_(LOG_STR("max"), LOG_STR("value undefined"));
|
this->log_perform_warning_two_strings_(LOG_STR("max"), LOG_STR("undefined"));
|
||||||
} else {
|
} else {
|
||||||
target_value = max_value;
|
target_value = max_value;
|
||||||
}
|
}
|
||||||
} else if (this->operation_ == NUMBER_OP_INCREMENT) {
|
} else if (this->operation_ == NUMBER_OP_INCREMENT) {
|
||||||
ESP_LOGD(TAG, "'%s': Increment, with%s cycling", name, this->cycle_ ? "" : "out");
|
ESP_LOGD(TAG, "'%s': Increment with%s cycling", name, this->cycle_ ? "" : "out");
|
||||||
if (!parent->has_state()) {
|
if (!parent->has_state()) {
|
||||||
this->log_perform_warning_two_strings_(LOG_STR("Can't increment,"), LOG_STR("no state"));
|
this->log_perform_warning_two_strings_(LOG_STR("Can't increment"), LOG_STR("no state"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto step = traits.get_step();
|
auto step = traits.get_step();
|
||||||
@@ -100,9 +100,9 @@ void NumberCall::perform() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this->operation_ == NUMBER_OP_DECREMENT) {
|
} else if (this->operation_ == NUMBER_OP_DECREMENT) {
|
||||||
ESP_LOGD(TAG, "'%s': Decrement, with%s cycling", name, this->cycle_ ? "" : "out");
|
ESP_LOGD(TAG, "'%s': Decrement with%s cycling", name, this->cycle_ ? "" : "out");
|
||||||
if (!parent->has_state()) {
|
if (!parent->has_state()) {
|
||||||
this->log_perform_warning_two_strings_(LOG_STR("Can't decrement,"), LOG_STR("no state"));
|
this->log_perform_warning_two_strings_(LOG_STR("Can't decrement"), LOG_STR("no state"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto step = traits.get_step();
|
auto step = traits.get_step();
|
||||||
|
Reference in New Issue
Block a user