From 54c9dd417395d0f5ab634b2a297286b71fcb39c2 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 27 Aug 2019 20:07:48 +0200 Subject: [PATCH] Fix WiFi Info dump_config change Fixes https://github.com/esphome/esphome/pull/698#discussion_r318212018 --- .../components/wifi_info/wifi_info_text_sensor.cpp | 14 ++++++++++++++ .../components/wifi_info/wifi_info_text_sensor.h | 3 --- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 esphome/components/wifi_info/wifi_info_text_sensor.cpp 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"; }