diff --git a/esphome/components/wifi_info/wifi_info_text_sensor.cpp b/esphome/components/wifi_info/wifi_info_text_sensor.cpp new file mode 100644 index 0000000000..283b876b5d --- /dev/null +++ b/esphome/components/wifi_info/wifi_info_text_sensor.cpp @@ -0,0 +1,14 @@ +#include "wifi_info_text_sensor.h" +#include "esphome/core/log.h" + +namespace esphome { +namespace wifi_info_text_sensor { + +static const char *TAG = "wifi_info"; + +void IPAddressWiFiInfo::dump_config() override { LOG_TEXT_SENSOR("", "WifiInfo IPAddress", this); } +void SSIDWiFiInfo::dump_config() override { LOG_TEXT_SENSOR("", "WifiInfo SSID", this); } +void BSSIDWiFiInfo::dump_config() override { LOG_TEXT_SENSOR("", "WifiInfo BSSID", this); } + +} // namespace wifi_info_text_sensor +} // namespace esphome diff --git a/esphome/components/wifi_info/wifi_info_text_sensor.h b/esphome/components/wifi_info/wifi_info_text_sensor.h index 258c185c53..73ea8511a3 100644 --- a/esphome/components/wifi_info/wifi_info_text_sensor.h +++ b/esphome/components/wifi_info/wifi_info_text_sensor.h @@ -18,7 +18,6 @@ class IPAddressWiFiInfo : public Component, public text_sensor::TextSensor { this->publish_state(ip.toString().c_str()); } } - void dump_config() override { LOG_TEXT_SENSOR("", "WifiInfo IPAddress Text Sensor", this); } float get_setup_priority() const override { return setup_priority::AFTER_WIFI; } std::string unique_id() override { return get_mac_address() + "-wifiinfo-ip"; } @@ -35,7 +34,6 @@ class SSIDWiFiInfo : public Component, public text_sensor::TextSensor { this->publish_state(this->last_ssid_); } } - void dump_config() override { LOG_TEXT_SENSOR("", "WifiInfo SSDID Text Sensor", this); } float get_setup_priority() const override { return setup_priority::AFTER_WIFI; } std::string unique_id() override { return get_mac_address() + "-wifiinfo-ssid"; } @@ -54,7 +52,6 @@ class BSSIDWiFiInfo : public Component, public text_sensor::TextSensor { this->publish_state(buf); } } - void dump_config() override { LOG_TEXT_SENSOR("", "WifiInfo BSSID Text Sensor", this); } float get_setup_priority() const override { return setup_priority::AFTER_WIFI; } std::string unique_id() override { return get_mac_address() + "-wifiinfo-bssid"; }