mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[code-quality] fix clang-tidy wifi related (#7254)
This commit is contained in:
		| @@ -1,4 +1,5 @@ | |||||||
| #include "wifi_component.h" | #include "wifi_component.h" | ||||||
|  | #ifdef USE_WIFI | ||||||
| #include <cinttypes> | #include <cinttypes> | ||||||
| #include <map> | #include <map> | ||||||
|  |  | ||||||
| @@ -856,3 +857,4 @@ WiFiComponent *global_wifi_component;  // NOLINT(cppcoreguidelines-avoid-non-con | |||||||
|  |  | ||||||
| }  // namespace wifi | }  // namespace wifi | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,9 +1,10 @@ | |||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
|  | #include "esphome/core/defines.h" | ||||||
|  | #ifdef USE_WIFI | ||||||
| #include "esphome/components/network/ip_address.h" | #include "esphome/components/network/ip_address.h" | ||||||
| #include "esphome/core/automation.h" | #include "esphome/core/automation.h" | ||||||
| #include "esphome/core/component.h" | #include "esphome/core/component.h" | ||||||
| #include "esphome/core/defines.h" |  | ||||||
| #include "esphome/core/helpers.h" | #include "esphome/core/helpers.h" | ||||||
|  |  | ||||||
| #include <string> | #include <string> | ||||||
| @@ -442,3 +443,4 @@ template<typename... Ts> class WiFiDisableAction : public Action<Ts...> { | |||||||
|  |  | ||||||
| }  // namespace wifi | }  // namespace wifi | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| #include "wifi_component.h" | #include "wifi_component.h" | ||||||
|  |  | ||||||
|  | #ifdef USE_WIFI | ||||||
| #ifdef USE_ESP32_FRAMEWORK_ARDUINO | #ifdef USE_ESP32_FRAMEWORK_ARDUINO | ||||||
|  |  | ||||||
| #include <esp_netif.h> | #include <esp_netif.h> | ||||||
| @@ -802,3 +803,4 @@ network::IPAddress WiFiComponent::wifi_dns_ip_(int num) { return network::IPAddr | |||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  |  | ||||||
| #endif  // USE_ESP32_FRAMEWORK_ARDUINO | #endif  // USE_ESP32_FRAMEWORK_ARDUINO | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| #include "wifi_component.h" | #include "wifi_component.h" | ||||||
| #include "esphome/core/defines.h" | #include "esphome/core/defines.h" | ||||||
|  |  | ||||||
|  | #ifdef USE_WIFI | ||||||
| #ifdef USE_ESP8266 | #ifdef USE_ESP8266 | ||||||
|  |  | ||||||
| #include <user_interface.h> | #include <user_interface.h> | ||||||
| @@ -834,3 +835,4 @@ void WiFiComponent::wifi_loop_() {} | |||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| #include "wifi_component.h" | #include "wifi_component.h" | ||||||
|  |  | ||||||
|  | #ifdef USE_WIFI | ||||||
| #ifdef USE_ESP_IDF | #ifdef USE_ESP_IDF | ||||||
|  |  | ||||||
| #include <esp_event.h> | #include <esp_event.h> | ||||||
| @@ -1010,3 +1011,4 @@ network::IPAddress WiFiComponent::wifi_dns_ip_(int num) { | |||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  |  | ||||||
| #endif  // USE_ESP_IDF | #endif  // USE_ESP_IDF | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| #include "wifi_component.h" | #include "wifi_component.h" | ||||||
|  |  | ||||||
|  | #ifdef USE_WIFI | ||||||
| #ifdef USE_LIBRETINY | #ifdef USE_LIBRETINY | ||||||
|  |  | ||||||
| #include <utility> | #include <utility> | ||||||
| @@ -468,3 +469,4 @@ void WiFiComponent::wifi_loop_() {} | |||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  |  | ||||||
| #endif  // USE_LIBRETINY | #endif  // USE_LIBRETINY | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
|  |  | ||||||
| #include "wifi_component.h" | #include "wifi_component.h" | ||||||
|  |  | ||||||
|  | #ifdef USE_WIFI | ||||||
| #ifdef USE_RP2040 | #ifdef USE_RP2040 | ||||||
|  |  | ||||||
| #include "lwip/dns.h" | #include "lwip/dns.h" | ||||||
| @@ -218,3 +219,4 @@ void WiFiComponent::wifi_pre_setup_() {} | |||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,4 +1,5 @@ | |||||||
| #include "wifi_info_text_sensor.h" | #include "wifi_info_text_sensor.h" | ||||||
|  | #ifdef USE_WIFI | ||||||
| #include "esphome/core/log.h" | #include "esphome/core/log.h" | ||||||
|  |  | ||||||
| namespace esphome { | namespace esphome { | ||||||
| @@ -15,3 +16,4 @@ void DNSAddressWifiInfo::dump_config() { LOG_TEXT_SENSOR("", "WifiInfo DNS Addre | |||||||
|  |  | ||||||
| }  // namespace wifi_info | }  // namespace wifi_info | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ | |||||||
| #include "esphome/core/component.h" | #include "esphome/core/component.h" | ||||||
| #include "esphome/components/text_sensor/text_sensor.h" | #include "esphome/components/text_sensor/text_sensor.h" | ||||||
| #include "esphome/components/wifi/wifi_component.h" | #include "esphome/components/wifi/wifi_component.h" | ||||||
|  | #ifdef USE_WIFI | ||||||
| #include <array> | #include <array> | ||||||
|  |  | ||||||
| namespace esphome { | namespace esphome { | ||||||
| @@ -131,3 +132,4 @@ class MacAddressWifiInfo : public Component, public text_sensor::TextSensor { | |||||||
|  |  | ||||||
| }  // namespace wifi_info | }  // namespace wifi_info | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,4 +1,5 @@ | |||||||
| #include "wifi_signal_sensor.h" | #include "wifi_signal_sensor.h" | ||||||
|  | #ifdef USE_WIFI | ||||||
| #include "esphome/core/log.h" | #include "esphome/core/log.h" | ||||||
|  |  | ||||||
| namespace esphome { | namespace esphome { | ||||||
| @@ -10,3 +11,4 @@ void WiFiSignalSensor::dump_config() { LOG_SENSOR("", "WiFi Signal", this); } | |||||||
|  |  | ||||||
| }  // namespace wifi_signal | }  // namespace wifi_signal | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
| #include "esphome/core/helpers.h" | #include "esphome/core/helpers.h" | ||||||
| #include "esphome/components/sensor/sensor.h" | #include "esphome/components/sensor/sensor.h" | ||||||
| #include "esphome/components/wifi/wifi_component.h" | #include "esphome/components/wifi/wifi_component.h" | ||||||
|  | #ifdef USE_WIFI | ||||||
| namespace esphome { | namespace esphome { | ||||||
| namespace wifi_signal { | namespace wifi_signal { | ||||||
|  |  | ||||||
| @@ -19,3 +19,4 @@ class WiFiSignalSensor : public sensor::Sensor, public PollingComponent { | |||||||
|  |  | ||||||
| }  // namespace wifi_signal | }  // namespace wifi_signal | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user