mirror of
https://github.com/esphome/esphome.git
synced 2025-09-03 03:42:20 +01:00
Added an option to disable mDNS (#1716)
* Added an option to disable mDNS * Fixed linter issues * Moved the enable_mdns option to WiFi and Ethernet components * extracted common method for add mdns library * lint Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
@@ -62,7 +62,7 @@ void WiFiComponent::setup() {
|
||||
}
|
||||
|
||||
this->wifi_apply_hostname_();
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
#if defined(ARDUINO_ARCH_ESP32) && defined(USE_MDNS)
|
||||
network_setup_mdns();
|
||||
#endif
|
||||
}
|
||||
@@ -171,7 +171,7 @@ void WiFiComponent::setup_ap_config_() {
|
||||
|
||||
this->ap_setup_ = this->wifi_start_ap_(this->ap_);
|
||||
ESP_LOGCONFIG(TAG, " IP Address: %s", this->wifi_soft_ap_ip().toString().c_str());
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
#if defined(ARDUINO_ARCH_ESP8266) && defined(USE_MDNS)
|
||||
network_setup_mdns(this->wifi_soft_ap_ip(), 1);
|
||||
#endif
|
||||
|
||||
@@ -466,7 +466,7 @@ void WiFiComponent::check_connecting_finished() {
|
||||
ESP_LOGD(TAG, "Disabling AP...");
|
||||
this->wifi_mode_({}, false);
|
||||
}
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
#if defined(ARDUINO_ARCH_ESP8266) && defined(USE_MDNS)
|
||||
network_setup_mdns(this->wifi_sta_ip_(), 0);
|
||||
#endif
|
||||
this->state_ = WIFI_COMPONENT_STATE_STA_CONNECTED;
|
||||
|
Reference in New Issue
Block a user