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";
36 service.txt_records.push_back({
"version", ESPHOME_VERSION});
38 const char *platform =
nullptr;
49 platform = lt_cpu_get_model_name();
51 if (platform !=
nullptr) {
52 service.txt_records.push_back({
"platform", platform});
55 service.txt_records.push_back({
"board", ESPHOME_BOARD});
58 service.txt_records.push_back({
"network",
"wifi"});
59 #elif defined(USE_ETHERNET) 60 service.txt_records.push_back({
"network",
"ethernet"});
64 service.txt_records.push_back({
"api_encryption",
"Noise_NNpsk0_25519_ChaChaPoly_SHA256"});
67 #ifdef ESPHOME_PROJECT_NAME 68 service.txt_records.push_back({
"project_name", ESPHOME_PROJECT_NAME});
69 service.txt_records.push_back({
"project_version", ESPHOME_PROJECT_VERSION});
70 #endif // ESPHOME_PROJECT_NAME 72 #ifdef USE_DASHBOARD_IMPORT 84 service.proto =
"_tcp";
85 service.port = USE_WEBSERVER_PORT;
94 service.proto =
"_tcp";
95 service.port = USE_WEBSERVER_PORT;
107 service.proto =
"_tcp";
108 service.port = USE_WEBSERVER_PORT;
109 service.txt_records.push_back({
"version", ESPHOME_VERSION});
115 ESP_LOGCONFIG(TAG,
"mDNS:");
116 ESP_LOGCONFIG(TAG,
" Hostname: %s", this->
hostname_.c_str());
117 ESP_LOGV(TAG,
" Services:");
118 for (
const auto &service : this->
services_) {
119 ESP_LOGV(TAG,
" - %s, %s, %d", service.service_type.c_str(), service.proto.c_str(), service.port);
120 for (
const auto &record : service.txt_records) {
121 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