mirror of
https://github.com/esphome/esphome.git
synced 2025-11-16 14:55:50 +00:00
[wifi][ethernet] Don't block setup until connected (#9823)
Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
@@ -418,8 +418,6 @@ void EthernetComponent::dump_config() {
|
|||||||
|
|
||||||
float EthernetComponent::get_setup_priority() const { return setup_priority::WIFI; }
|
float EthernetComponent::get_setup_priority() const { return setup_priority::WIFI; }
|
||||||
|
|
||||||
bool EthernetComponent::can_proceed() { return this->is_connected(); }
|
|
||||||
|
|
||||||
network::IPAddresses EthernetComponent::get_ip_addresses() {
|
network::IPAddresses EthernetComponent::get_ip_addresses() {
|
||||||
network::IPAddresses addresses;
|
network::IPAddresses addresses;
|
||||||
esp_netif_ip_info_t ip;
|
esp_netif_ip_info_t ip;
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ class EthernetComponent : public Component {
|
|||||||
void loop() override;
|
void loop() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override;
|
float get_setup_priority() const override;
|
||||||
bool can_proceed() override;
|
|
||||||
void on_powerdown() override { powerdown(); }
|
void on_powerdown() override { powerdown(); }
|
||||||
bool is_connected();
|
bool is_connected();
|
||||||
|
|
||||||
|
|||||||
@@ -1443,12 +1443,6 @@ void WiFiComponent::retry_connect() {
|
|||||||
this->action_started_ = millis();
|
this->action_started_ = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiFiComponent::can_proceed() {
|
|
||||||
if (!this->has_sta() || this->state_ == WIFI_COMPONENT_STATE_DISABLED || this->ap_setup_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return this->is_connected();
|
|
||||||
}
|
|
||||||
void WiFiComponent::set_reboot_timeout(uint32_t reboot_timeout) { this->reboot_timeout_ = reboot_timeout; }
|
void WiFiComponent::set_reboot_timeout(uint32_t reboot_timeout) { this->reboot_timeout_ = reboot_timeout; }
|
||||||
bool WiFiComponent::is_connected() {
|
bool WiFiComponent::is_connected() {
|
||||||
return this->state_ == WIFI_COMPONENT_STATE_STA_CONNECTED &&
|
return this->state_ == WIFI_COMPONENT_STATE_STA_CONNECTED &&
|
||||||
|
|||||||
@@ -269,8 +269,6 @@ class WiFiComponent : public Component {
|
|||||||
|
|
||||||
void retry_connect();
|
void retry_connect();
|
||||||
|
|
||||||
bool can_proceed() override;
|
|
||||||
|
|
||||||
void set_reboot_timeout(uint32_t reboot_timeout);
|
void set_reboot_timeout(uint32_t reboot_timeout);
|
||||||
|
|
||||||
bool is_connected();
|
bool is_connected();
|
||||||
|
|||||||
Reference in New Issue
Block a user