mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
Ensure wifi is in at least station mode before starting improv (#1899)
This commit is contained in:
parent
a57a842f7b
commit
4b91cfb7f9
1 changed files with 7 additions and 6 deletions
|
@ -79,6 +79,7 @@ void WiFiComponent::setup() {
|
||||||
}
|
}
|
||||||
#ifdef USE_IMPROV
|
#ifdef USE_IMPROV
|
||||||
if (esp32_improv::global_improv_component != nullptr)
|
if (esp32_improv::global_improv_component != nullptr)
|
||||||
|
if (this->wifi_mode_(true, {}))
|
||||||
esp32_improv::global_improv_component->start();
|
esp32_improv::global_improv_component->start();
|
||||||
#endif
|
#endif
|
||||||
this->wifi_apply_hostname_();
|
this->wifi_apply_hostname_();
|
||||||
|
@ -143,11 +144,11 @@ void WiFiComponent::loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_IMPROV
|
#ifdef USE_IMPROV
|
||||||
if (esp32_improv::global_improv_component != nullptr) {
|
if (esp32_improv::global_improv_component != nullptr)
|
||||||
if (!this->is_connected()) {
|
if (!this->is_connected())
|
||||||
|
if (this->wifi_mode_(true, {}))
|
||||||
esp32_improv::global_improv_component->start();
|
esp32_improv::global_improv_component->start();
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!this->has_ap() && this->reboot_timeout_ != 0) {
|
if (!this->has_ap() && this->reboot_timeout_ != 0) {
|
||||||
|
|
Loading…
Reference in a new issue