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

Add text component (#5336)

Co-authored-by: Maurits <maurits@vloop.nl>
Co-authored-by: mauritskorse <mauritskorse@gmail.com>
Co-authored-by: Daniel Dunn <dannydunn@eternityforest.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Daniel Dunn
2023-10-25 03:00:32 -06:00
committed by GitHub
parent cf7df9e360
commit e80bd8ed3d
50 changed files with 1545 additions and 7 deletions

View File

@@ -216,6 +216,15 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
std::string number_json(number::Number *obj, float value, JsonDetail start_config);
#endif
#ifdef USE_TEXT
void on_text_update(text::Text *obj, const std::string &state) override;
/// Handle a text input request under '/text/<id>'.
void handle_text_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the text state with its value as a JSON string.
std::string text_json(text::Text *obj, const std::string &value, JsonDetail start_config);
#endif
#ifdef USE_SELECT
void on_select_update(select::Select *obj, const std::string &state, size_t index) override;
/// Handle a select request under '/select/<id>'.