mirror of
https://github.com/esphome/esphome.git
synced 2026-10-01 08:50:22 +00:00
[core] Fix status_momentary API misuse and optimize parameter type (#12216)
This commit is contained in:
@@ -369,11 +369,11 @@ void Component::status_clear_error() {
|
||||
this->component_state_ &= ~STATUS_LED_ERROR;
|
||||
ESP_LOGE(TAG, "%s cleared Error flag", LOG_STR_ARG(this->get_component_log_str()));
|
||||
}
|
||||
void Component::status_momentary_warning(const std::string &name, uint32_t length) {
|
||||
void Component::status_momentary_warning(const char *name, uint32_t length) {
|
||||
this->status_set_warning();
|
||||
this->set_timeout(name, length, [this]() { this->status_clear_warning(); });
|
||||
}
|
||||
void Component::status_momentary_error(const std::string &name, uint32_t length) {
|
||||
void Component::status_momentary_error(const char *name, uint32_t length) {
|
||||
this->status_set_error();
|
||||
this->set_timeout(name, length, [this]() { this->status_clear_error(); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user