mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 01:34:18 +01:00
web_server
This commit is contained in:
parent
4b91ef5123
commit
c5d4eef56f
2 changed files with 5 additions and 4 deletions
|
@ -334,7 +334,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
|
||||||
/// Override the web handler's handleRequest method.
|
/// Override the web handler's handleRequest method.
|
||||||
void handleRequest(AsyncWebServerRequest *request) override;
|
void handleRequest(AsyncWebServerRequest *request) override;
|
||||||
/// This web handle is not trivial.
|
/// This web handle is not trivial.
|
||||||
bool isRequestHandlerTrivial() override;
|
bool isRequestHandlerTrivial() override; // NOLINT(readability-identifier-naming)
|
||||||
|
|
||||||
void add_entity_to_sorting_list(EntityBase *entity, float weight);
|
void add_entity_to_sorting_list(EntityBase *entity, float weight);
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ class MiddlewareHandler : public AsyncWebHandler {
|
||||||
void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) override {
|
void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) override {
|
||||||
next_->handleBody(request, data, len, index, total);
|
next_->handleBody(request, data, len, index, total);
|
||||||
}
|
}
|
||||||
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
||||||
bool isRequestHandlerTrivial() override { return next_->isRequestHandlerTrivial(); }
|
bool isRequestHandlerTrivial() override { return next_->isRequestHandlerTrivial(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -104,8 +105,8 @@ class WebServerBase : public Component {
|
||||||
std::shared_ptr<AsyncWebServer> get_server() const { return server_; }
|
std::shared_ptr<AsyncWebServer> get_server() const { return server_; }
|
||||||
float get_setup_priority() const override;
|
float get_setup_priority() const override;
|
||||||
|
|
||||||
void set_auth_username(std::string auth_username) { credentials_.username = std::move(auth_username); }
|
void set_auth_username(std::string &&auth_username) { credentials_.username = std::move(auth_username); }
|
||||||
void set_auth_password(std::string auth_password) { credentials_.password = std::move(auth_password); }
|
void set_auth_password(std::string &&auth_password) { credentials_.password = std::move(auth_password); }
|
||||||
|
|
||||||
void add_handler(AsyncWebHandler *handler);
|
void add_handler(AsyncWebHandler *handler);
|
||||||
|
|
||||||
|
@ -133,7 +134,7 @@ class OTARequestHandler : public AsyncWebHandler {
|
||||||
bool canHandle(AsyncWebServerRequest *request) override {
|
bool canHandle(AsyncWebServerRequest *request) override {
|
||||||
return request->url() == "/update" && request->method() == HTTP_POST;
|
return request->url() == "/update" && request->method() == HTTP_POST;
|
||||||
}
|
}
|
||||||
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
||||||
bool isRequestHandlerTrivial() override { return false; }
|
bool isRequestHandlerTrivial() override { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue