mirror of
https://github.com/esphome/esphome.git
synced 2025-01-18 10:25:56 +01:00
Rename WEBSERVER_PORT define to USE_WEBSERVER_PORT (#3102)
This commit is contained in:
parent
2a84db7f85
commit
c2ee0f0864
6 changed files with 9 additions and 9 deletions
|
@ -805,7 +805,7 @@ DeviceInfoResponse APIConnection::device_info(const DeviceInfoRequest &msg) {
|
||||||
resp.project_version = ESPHOME_PROJECT_VERSION;
|
resp.project_version = ESPHOME_PROJECT_VERSION;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_WEBSERVER
|
#ifdef USE_WEBSERVER
|
||||||
resp.webserver_port = WEBSERVER_PORT;
|
resp.webserver_port = USE_WEBSERVER_PORT;
|
||||||
#endif
|
#endif
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ void ESP32ImprovComponent::loop() {
|
||||||
std::vector<std::string> urls = {ESPHOME_MY_LINK};
|
std::vector<std::string> urls = {ESPHOME_MY_LINK};
|
||||||
#ifdef USE_WEBSERVER
|
#ifdef USE_WEBSERVER
|
||||||
auto ip = wifi::global_wifi_component->wifi_sta_ip();
|
auto ip = wifi::global_wifi_component->wifi_sta_ip();
|
||||||
std::string webserver_url = "http://" + ip.str() + ":" + to_string(WEBSERVER_PORT);
|
std::string webserver_url = "http://" + ip.str() + ":" + to_string(USE_WEBSERVER_PORT);
|
||||||
urls.push_back(webserver_url);
|
urls.push_back(webserver_url);
|
||||||
#endif
|
#endif
|
||||||
std::vector<uint8_t> data = improv::build_rpc_response(improv::WIFI_SETTINGS, urls);
|
std::vector<uint8_t> data = improv::build_rpc_response(improv::WIFI_SETTINGS, urls);
|
||||||
|
|
|
@ -95,7 +95,7 @@ std::vector<uint8_t> ImprovSerialComponent::build_rpc_settings_response_(improv:
|
||||||
std::vector<std::string> urls;
|
std::vector<std::string> urls;
|
||||||
#ifdef USE_WEBSERVER
|
#ifdef USE_WEBSERVER
|
||||||
auto ip = wifi::global_wifi_component->wifi_sta_ip();
|
auto ip = wifi::global_wifi_component->wifi_sta_ip();
|
||||||
std::string webserver_url = "http://" + ip.str() + ":" + to_string(WEBSERVER_PORT);
|
std::string webserver_url = "http://" + ip.str() + ":" + to_string(USE_WEBSERVER_PORT);
|
||||||
urls.push_back(webserver_url);
|
urls.push_back(webserver_url);
|
||||||
#endif
|
#endif
|
||||||
std::vector<uint8_t> data = improv::build_rpc_response(command, urls, false);
|
std::vector<uint8_t> data = improv::build_rpc_response(command, urls, false);
|
||||||
|
|
|
@ -16,8 +16,8 @@ namespace mdns {
|
||||||
|
|
||||||
static const char *const TAG = "mdns";
|
static const char *const TAG = "mdns";
|
||||||
|
|
||||||
#ifndef WEBSERVER_PORT
|
#ifndef USE_WEBSERVER_PORT
|
||||||
#define WEBSERVER_PORT 80 // NOLINT
|
#define USE_WEBSERVER_PORT 80 // NOLINT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void MDNSComponent::compile_records_() {
|
void MDNSComponent::compile_records_() {
|
||||||
|
@ -63,7 +63,7 @@ void MDNSComponent::compile_records_() {
|
||||||
MDNSService service{};
|
MDNSService service{};
|
||||||
service.service_type = "_prometheus-http";
|
service.service_type = "_prometheus-http";
|
||||||
service.proto = "_tcp";
|
service.proto = "_tcp";
|
||||||
service.port = WEBSERVER_PORT;
|
service.port = USE_WEBSERVER_PORT;
|
||||||
this->services_.push_back(service);
|
this->services_.push_back(service);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,7 +74,7 @@ void MDNSComponent::compile_records_() {
|
||||||
MDNSService service{};
|
MDNSService service{};
|
||||||
service.service_type = "_http";
|
service.service_type = "_http";
|
||||||
service.proto = "_tcp";
|
service.proto = "_tcp";
|
||||||
service.port = WEBSERVER_PORT;
|
service.port = USE_WEBSERVER_PORT;
|
||||||
service.txt_records.push_back({"version", ESPHOME_VERSION});
|
service.txt_records.push_back({"version", ESPHOME_VERSION});
|
||||||
this->services_.push_back(service);
|
this->services_.push_back(service);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,8 +66,8 @@ async def to_code(config):
|
||||||
cg.add_define("USE_WEBSERVER")
|
cg.add_define("USE_WEBSERVER")
|
||||||
|
|
||||||
cg.add(paren.set_port(config[CONF_PORT]))
|
cg.add(paren.set_port(config[CONF_PORT]))
|
||||||
cg.add_define("WEBSERVER_PORT", config[CONF_PORT])
|
|
||||||
cg.add_define("USE_WEBSERVER")
|
cg.add_define("USE_WEBSERVER")
|
||||||
|
cg.add_define("USE_WEBSERVER_PORT", config[CONF_PORT])
|
||||||
cg.add(var.set_css_url(config[CONF_CSS_URL]))
|
cg.add(var.set_css_url(config[CONF_CSS_URL]))
|
||||||
cg.add(var.set_js_url(config[CONF_JS_URL]))
|
cg.add(var.set_js_url(config[CONF_JS_URL]))
|
||||||
cg.add(var.set_allow_ota(config[CONF_OTA]))
|
cg.add(var.set_allow_ota(config[CONF_OTA]))
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
#define USE_MQTT
|
#define USE_MQTT
|
||||||
#define USE_PROMETHEUS
|
#define USE_PROMETHEUS
|
||||||
#define USE_WEBSERVER
|
#define USE_WEBSERVER
|
||||||
|
#define USE_WEBSERVER_PORT 80 // NOLINT
|
||||||
#define USE_WIFI_WPA2_EAP
|
#define USE_WIFI_WPA2_EAP
|
||||||
#define WEBSERVER_PORT 80 // NOLINT
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ESP32-specific feature flags
|
// ESP32-specific feature flags
|
||||||
|
|
Loading…
Reference in a new issue