mirror of
https://github.com/esphome/esphome.git
synced 2025-08-09 20:07:50 +00:00
tweak
This commit is contained in:
parent
8563a5785f
commit
727161f1db
@ -47,7 +47,9 @@ void CaptivePortal::start() {
|
|||||||
this->base_->init();
|
this->base_->init();
|
||||||
if (!this->initialized_) {
|
if (!this->initialized_) {
|
||||||
this->base_->add_handler(this);
|
this->base_->add_handler(this);
|
||||||
|
#ifdef USE_WEBSERVER_OTA
|
||||||
this->base_->add_ota_handler();
|
this->base_->add_ota_handler();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_ARDUINO
|
#ifdef USE_ARDUINO
|
||||||
|
@ -256,8 +256,10 @@ void WebServer::setup() {
|
|||||||
#endif
|
#endif
|
||||||
this->base_->add_handler(this);
|
this->base_->add_handler(this);
|
||||||
|
|
||||||
|
#ifdef USE_WEBSERVER_OTA
|
||||||
if (this->allow_ota_)
|
if (this->allow_ota_)
|
||||||
this->base_->add_ota_handler();
|
this->base_->add_ota_handler();
|
||||||
|
#endif
|
||||||
|
|
||||||
// doesn't need defer functionality - if the queue is full, the client JS knows it's alive because it's clearly
|
// doesn't need defer functionality - if the queue is full, the client JS knows it's alive because it's clearly
|
||||||
// getting a lot of events
|
// getting a lot of events
|
||||||
|
@ -186,11 +186,12 @@ void OTARequestHandler::handleRequest(AsyncWebServerRequest *request) {
|
|||||||
#endif // USE_WEBSERVER_OTA
|
#endif // USE_WEBSERVER_OTA
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebServerBase::add_ota_handler() {
|
|
||||||
#ifdef USE_WEBSERVER_OTA
|
#ifdef USE_WEBSERVER_OTA
|
||||||
|
void WebServerBase::add_ota_handler() {
|
||||||
this->add_handler(new OTARequestHandler(this)); // NOLINT
|
this->add_handler(new OTARequestHandler(this)); // NOLINT
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
float WebServerBase::get_setup_priority() const {
|
float WebServerBase::get_setup_priority() const {
|
||||||
// Before WiFi (captive portal)
|
// Before WiFi (captive portal)
|
||||||
return setup_priority::WIFI + 2.0f;
|
return setup_priority::WIFI + 2.0f;
|
||||||
|
@ -110,7 +110,9 @@ class WebServerBase : public Component {
|
|||||||
|
|
||||||
void add_handler(AsyncWebHandler *handler);
|
void add_handler(AsyncWebHandler *handler);
|
||||||
|
|
||||||
|
#ifdef USE_WEBSERVER_OTA
|
||||||
void add_ota_handler();
|
void add_ota_handler();
|
||||||
|
#endif
|
||||||
|
|
||||||
void set_port(uint16_t port) { port_ = port; }
|
void set_port(uint16_t port) { port_ = port; }
|
||||||
uint16_t get_port() const { return port_; }
|
uint16_t get_port() const { return port_; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user