mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
Fix WiFi Info dump_config change
Fixes https://github.com/esphome/esphome/pull/698#discussion_r318212018
This commit is contained in:
parent
0fc267dfc7
commit
54c9dd4173
2 changed files with 14 additions and 3 deletions
14
esphome/components/wifi_info/wifi_info_text_sensor.cpp
Normal file
14
esphome/components/wifi_info/wifi_info_text_sensor.cpp
Normal 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
|
|
@ -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"; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue