1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00
This commit is contained in:
J. Nick Koston
2025-07-24 21:07:43 -10:00
parent 6a9f1d9b2e
commit 9d20b04512

View File

@@ -149,7 +149,7 @@ uint8_t Component::get_component_state() const { return this->component_state_;
void Component::call() { void Component::call() {
uint8_t state = this->component_state_ & COMPONENT_STATE_MASK; uint8_t state = this->component_state_ & COMPONENT_STATE_MASK;
switch (state) { switch (state) {
case COMPONENT_STATE_CONSTRUCTION: case COMPONENT_STATE_CONSTRUCTION: {
// State Construction: Call setup and set state to setup // State Construction: Call setup and set state to setup
this->set_component_state_(COMPONENT_STATE_SETUP); this->set_component_state_(COMPONENT_STATE_SETUP);
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG
@@ -162,6 +162,7 @@ void Component::call() {
ESP_LOGD(TAG, "Setup %s took %ums", this->get_component_source(), setup_time); ESP_LOGD(TAG, "Setup %s took %ums", this->get_component_source(), setup_time);
#endif #endif
break; break;
}
case COMPONENT_STATE_SETUP: case COMPONENT_STATE_SETUP:
// State setup: Call first loop and set state to loop // State setup: Call first loop and set state to loop
this->set_component_state_(COMPONENT_STATE_LOOP); this->set_component_state_(COMPONENT_STATE_LOOP);