supla-device
Loading...
Searching...
No Matches
button_update.h
1/*
2 Copyright (C) Petione for AC SOFTWARE SP. Z O.O.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17*/
18
19#ifndef SRC_SUPLA_NETWORK_HTML_BUTTON_UPDATE_H_
20#define SRC_SUPLA_NETWORK_HTML_BUTTON_UPDATE_H_
21
22#if !defined(ARDUINO) && !defined(SUPLA_TEST)
23#error "ButtonUpdate is Arduino-only and intended for debug/DIY usage."
24#endif
25
26#include <supla/network/html_element.h>
27
28namespace Supla {
29class EspWebServer;
30} // namespace Supla
31
32#ifdef ARDUINO_ARCH_ESP32
33#include <HTTPUpdateServer.h>
34#else
35#include <ESP8266HTTPUpdateServer.h>
36#endif
37
38namespace Supla {
39namespace Html {
40
41class ButtonUpdate : public HtmlElement {
42 private:
43 Supla::EspWebServer* server = nullptr;
44
45#ifdef ARDUINO_ARCH_ESP32
46 HTTPUpdateServer* httpUpdater = nullptr;
47#else
48 ESP8266HTTPUpdateServer* httpUpdater = nullptr;
49#endif
50
51 public:
52 explicit ButtonUpdate(Supla::EspWebServer* server);
53 ~ButtonUpdate();
54 void send(Supla::WebSender* sender) override;
55};
56
57}; // namespace Html
58}; // namespace Supla
59
60#endif // SRC_SUPLA_NETWORK_HTML_BUTTON_UPDATE_H_
Definition esp_web_server.h:49
Definition web_sender.h:175