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

Add Number entities (from Home Assistant) (#1971)

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
Jesse Hills
2021-07-13 07:20:12 +12:00
committed by GitHub
parent 1f5c79bd17
commit dd37a4e04c
36 changed files with 1206 additions and 0 deletions

View File

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