1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-24 04:33:49 +01:00

Add select entities and implement template select (#2067)

Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
Jesse Hills
2021-08-02 20:00:51 +12:00
committed by GitHub
parent 69c7cf783e
commit 76991cdcc4
35 changed files with 1053 additions and 0 deletions

View File

@@ -163,6 +163,15 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
std::string number_json(number::Number *obj, float value);
#endif
#ifdef USE_SELECT
void on_select_update(select::Select *obj, const std::string &state) override;
/// Handle a select request under '/select/<id>'.
void handle_select_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the number state with its value as a JSON string.
std::string select_json(select::Select *obj, const std::string &value);
#endif
/// Override the web handler's canHandle method.
bool canHandle(AsyncWebServerRequest *request) override;
/// Override the web handler's handleRequest method.