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

Add support for button entities (#2824)

This commit is contained in:
Jesse Hills
2021-11-30 08:00:51 +13:00
committed by GitHub
parent f50e40e0b8
commit b5639a6472
34 changed files with 697 additions and 0 deletions

View File

@@ -112,6 +112,11 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
std::string switch_json(switch_::Switch *obj, bool value);
#endif
#ifdef USE_BUTTON
/// Handle a button request under '/button/<id>/press'.
void handle_button_request(AsyncWebServerRequest *request, const UrlMatch &match);
#endif
#ifdef USE_BINARY_SENSOR
void on_binary_sensor_update(binary_sensor::BinarySensor *obj, bool state) override;