5 #include "list_entities.h" 14 #include <freertos/FreeRTOS.h> 15 #include <freertos/semphr.h> 18 namespace web_server {
48 void set_css_url(
const char *css_url);
54 void set_css_include(
const char *css_include);
61 void set_js_url(
const char *js_url);
67 void set_js_include(
const char *js_include);
84 void setup()
override;
87 void dump_config()
override;
90 float get_setup_priority()
const override;
93 void handle_index_request(AsyncWebServerRequest *request);
95 #ifdef USE_WEBSERVER_CSS_INCLUDE 96 void handle_css_request(AsyncWebServerRequest *request);
100 #ifdef USE_WEBSERVER_JS_INCLUDE 101 void handle_js_request(AsyncWebServerRequest *request);
108 void handle_sensor_request(AsyncWebServerRequest *request,
const UrlMatch &match);
118 void handle_switch_request(AsyncWebServerRequest *request,
const UrlMatch &match);
125 void handle_button_request(AsyncWebServerRequest *request,
const UrlMatch &match);
132 #ifdef USE_BINARY_SENSOR 136 void handle_binary_sensor_request(AsyncWebServerRequest *request,
const UrlMatch &match);
143 void on_fan_update(
fan::Fan *obj)
override;
146 void handle_fan_request(AsyncWebServerRequest *request,
const UrlMatch &match);
156 void handle_light_request(AsyncWebServerRequest *request,
const UrlMatch &match);
162 #ifdef USE_TEXT_SENSOR 166 void handle_text_sensor_request(AsyncWebServerRequest *request,
const UrlMatch &match);
176 void handle_cover_request(AsyncWebServerRequest *request,
const UrlMatch &match);
185 void handle_number_request(AsyncWebServerRequest *request,
const UrlMatch &match);
192 void on_select_update(
select::Select *obj,
const std::string &state,
size_t index)
override;
194 void handle_select_request(AsyncWebServerRequest *request,
const UrlMatch &match);
203 void handle_climate_request(AsyncWebServerRequest *request,
const UrlMatch &match);
210 void on_lock_update(
lock::Lock *obj)
override;
213 void handle_lock_request(AsyncWebServerRequest *request,
const UrlMatch &match);
220 bool canHandle(AsyncWebServerRequest *request)
override;
222 void handleRequest(AsyncWebServerRequest *request)
override;
224 bool isRequestHandlerTrivial()
override;
227 void schedule_(std::function<
void()> &&f);
230 AsyncEventSource events_{
"/events"};
232 const char *css_url_{
nullptr};
233 const char *css_include_{
nullptr};
234 const char *js_url_{
nullptr};
235 const char *js_include_{
nullptr};
236 bool include_internal_{
false};
237 bool allow_ota_{
true};
247 #endif // USE_ARDUINO
Base class for all switches.
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Base class for all cover devices.
void set_allow_ota(bool allow_ota)
Set whether or not the webserver should expose the OTA form and handler.
SemaphoreHandle_t to_schedule_lock_
This class allows users to create a web server with their ESP nodes.
void set_include_internal(bool include_internal)
Determine whether internal components should be displayed on the web server.
friend ListEntitiesIterator
Internal helper struct that is used to parse incoming URLs.
std::string domain
The domain of the component, for example "sensor".
Base-class for all numbers.
bool valid
Whether this match is valid.
std::string id
The id of the device that's being accessed, for example "living_room_fan".
Base-class for all selects.
web_server_base::WebServerBase * base_
Base class for all binary_sensor-type classes.
LockState
Enum for all states a lock can be in.
Base-class for all sensors.
ListEntitiesIterator entities_iterator_
std::deque< std::function< void()> > to_schedule_
std::string method
The method that's being called, for example "turn_on".
Base class for all locks.
ClimateDevice - This is the base class for all climate integrations.