11 #ifdef USE_DASHBOARD_IMPORT 18 static const char *
const TAG =
"mdns";
20 #ifndef USE_WEBSERVER_PORT 21 #define USE_WEBSERVER_PORT 80 // NOLINT 32 service.proto =
"_tcp";
37 service.txt_records.push_back({
"version", ESPHOME_VERSION});
39 const char *platform =
nullptr;
50 platform = lt_cpu_get_model_name();
52 if (platform !=
nullptr) {
53 service.txt_records.push_back({
"platform", platform});
56 service.txt_records.push_back({
"board", ESPHOME_BOARD});
59 service.txt_records.push_back({
"network",
"wifi"});
60 #elif defined(USE_ETHERNET) 61 service.txt_records.push_back({
"network",
"ethernet"});
65 service.txt_records.push_back({
"api_encryption",
"Noise_NNpsk0_25519_ChaChaPoly_SHA256"});
68 #ifdef ESPHOME_PROJECT_NAME 69 service.txt_records.push_back({
"project_name", ESPHOME_PROJECT_NAME});
70 service.txt_records.push_back({
"project_version", ESPHOME_PROJECT_VERSION});
71 #endif // ESPHOME_PROJECT_NAME 73 #ifdef USE_DASHBOARD_IMPORT 85 service.proto =
"_tcp";
86 service.port = USE_WEBSERVER_PORT;
95 service.proto =
"_tcp";
96 service.port = USE_WEBSERVER_PORT;
108 service.proto =
"_tcp";
109 service.port = USE_WEBSERVER_PORT;
110 service.txt_records.push_back({
"version", ESPHOME_VERSION});
116 ESP_LOGCONFIG(TAG,
"mDNS:");
117 ESP_LOGCONFIG(TAG,
" Hostname: %s", this->
hostname_.c_str());
118 ESP_LOGV(TAG,
" Services:");
119 for (
const auto &service : this->
services_) {
120 ESP_LOGV(TAG,
" - %s, %s, %d", service.service_type.c_str(), service.proto.c_str(), service.port);
121 for (
const auto &record : service.txt_records) {
122 ESP_LOGV(TAG,
" TXT: %s = %s", record.key.c_str(), record.value.c_str());
void dump_config() override
const std::string & get_friendly_name() const
Get the friendly name of this Application set by pre_setup().
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 pre_setup().
Implementation of SPI Controller mode.
std::vector< MDNSService > services_extra_
uint16_t get_port() const
APIServer * global_api_server