10 #ifdef USE_DASHBOARD_IMPORT 17 static const char *
const TAG =
"mdns";
19 #ifndef USE_WEBSERVER_PORT 20 #define USE_WEBSERVER_PORT 80 // NOLINT 31 service.proto =
"_tcp";
33 service.txt_records.push_back({
"version", ESPHOME_VERSION});
35 const char *platform =
nullptr;
45 if (platform !=
nullptr) {
46 service.txt_records.push_back({
"platform", platform});
49 service.txt_records.push_back({
"board", ESPHOME_BOARD});
52 service.txt_records.push_back({
"network",
"wifi"});
53 #elif defined(USE_ETHERNET) 54 service.txt_records.push_back({
"network",
"ethernet"});
57 #ifdef ESPHOME_PROJECT_NAME 58 service.txt_records.push_back({
"project_name", ESPHOME_PROJECT_NAME});
59 service.txt_records.push_back({
"project_version", ESPHOME_PROJECT_VERSION});
60 #endif // ESPHOME_PROJECT_NAME 62 #ifdef USE_DASHBOARD_IMPORT 74 service.proto =
"_tcp";
75 service.port = USE_WEBSERVER_PORT;
84 service.proto =
"_tcp";
85 service.port = USE_WEBSERVER_PORT;
95 service.proto =
"_tcp";
96 service.port = USE_WEBSERVER_PORT;
97 service.txt_records.push_back({
"version", ESPHOME_VERSION});
103 ESP_LOGCONFIG(TAG,
"mDNS:");
104 ESP_LOGCONFIG(TAG,
" Hostname: %s", this->
hostname_.c_str());
105 ESP_LOGV(TAG,
" Services:");
106 for (
const auto &service : this->
services_) {
107 ESP_LOGV(TAG,
" - %s, %s, %d", service.service_type.c_str(), service.proto.c_str(), service.port);
108 for (
const auto &record : service.txt_records) {
109 ESP_LOGV(TAG,
" TXT: %s = %s", record.key.c_str(), record.value.c_str());
void dump_config() override
std::string get_mac_address()
Get the device MAC address as a string, in lowercase hex notation.
std::vector< MDNSService > services_
Application App
Global storage of Application pointer - only one Application can exist.
std::string get_package_import_url()
const std::string & get_name() const
Get the name of this Application set by set_name().
uint16_t get_port() const
APIServer * global_api_server