supla-device
Loading...
Searching...
No Matches
button_update.h
1// SPDX-FileCopyrightText: Petione for AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_NETWORK_HTML_BUTTON_UPDATE_H_
5#define SRC_SUPLA_NETWORK_HTML_BUTTON_UPDATE_H_
6
7#if !defined(ARDUINO) && !defined(SUPLA_TEST)
8#error "ButtonUpdate is Arduino-only and intended for debug/DIY usage."
9#endif
10
11#include <supla/network/html_element.h>
12
13namespace Supla {
14class EspWebServer;
15} // namespace Supla
16
17#ifdef ARDUINO_ARCH_ESP32
18#include <HTTPUpdateServer.h>
19#else
20#include <ESP8266HTTPUpdateServer.h>
21#endif
22
23namespace Supla {
24namespace Html {
25
26class ButtonUpdate : public HtmlElement {
27 private:
28 Supla::EspWebServer* server = nullptr;
29
30#ifdef ARDUINO_ARCH_ESP32
31 HTTPUpdateServer* httpUpdater = nullptr;
32#else
33 ESP8266HTTPUpdateServer* httpUpdater = nullptr;
34#endif
35
36 public:
37 explicit ButtonUpdate(Supla::EspWebServer* server);
39 void send(Supla::WebSender* sender) override;
40};
41
42}; // namespace Html
43}; // namespace Supla
44
45#endif // SRC_SUPLA_NETWORK_HTML_BUTTON_UPDATE_H_
Definition esp_web_server.h:36
Definition html_element.h:22
Definition button_update.h:26
Definition web_sender.h:160