Fix WiFi Info dump_config change

Fixes https://github.com/esphome/esphome/pull/698#discussion_r318212018
This commit is contained in:
Otto Winter 2019-08-27 20:07:48 +02:00
parent 0fc267dfc7
commit 54c9dd4173
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E
2 changed files with 14 additions and 3 deletions

View file

@ -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

View file

@ -18,7 +18,6 @@ class IPAddressWiFiInfo : public Component, public text_sensor::TextSensor {
this->publish_state(ip.toString().c_str()); 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; } float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
std::string unique_id() override { return get_mac_address() + "-wifiinfo-ip"; } 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_); 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; } float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
std::string unique_id() override { return get_mac_address() + "-wifiinfo-ssid"; } 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); 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; } float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
std::string unique_id() override { return get_mac_address() + "-wifiinfo-bssid"; } std::string unique_id() override { return get_mac_address() + "-wifiinfo-bssid"; }