Fix ethernet logging too many warn messages (#1112)

This commit is contained in:
Guillermo Ruffino 2020-07-08 15:25:32 -03:00 committed by GitHub
parent 382793de9a
commit 6873f09f57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@ void EthernetComponent::setup() {
} }
void EthernetComponent::loop() { void EthernetComponent::loop() {
const uint32_t now = millis(); const uint32_t now = millis();
if (!this->connected_ && !this->last_connected_ && now - this->last_connected_ > 15000) { if (!this->connected_ && !this->last_connected_ && now - this->connect_begin_ > 15000) {
ESP_LOGW(TAG, "Connecting via ethernet failed! Re-connecting..."); ESP_LOGW(TAG, "Connecting via ethernet failed! Re-connecting...");
this->start_connect_(); this->start_connect_();
return; return;