forked from MTJoker/HomeStatusDisplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HSDWebserver.hpp
53 lines (39 loc) · 1.04 KB
/
HSDWebserver.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <ESP8266WebServer.h>
#include <ESP8266HTTPUpdateServer.h>
#include "HSDConfig.hpp"
#include "HSDLeds.hpp"
#include "HSDMqtt.hpp"
#include "HSDHtmlHelper.hpp"
class HSDWebserver
{
public:
HSDWebserver(HSDConfig& config, const HSDLeds& leds, const HSDMqtt& mqtt);
void begin();
void handleClient(unsigned long deviceUptime);
private:
void deliverRootPage();
void deliverStatusPage();
void deliverColorMappingPage();
void deliverDeviceMappingPage();
void deliverNotFoundPage();
void checkReboot();
bool updateMainConfig();
bool needAdd();
bool needDelete();
bool needDeleteAll();
bool needSave();
bool needUndo();
bool addColorMappingEntry();
bool deleteColorMappingEntry();
bool addDeviceMappingEntry();
bool deleteDeviceMappingEntry();
bool updateDeviceMappingConfig();
ESP8266WebServer m_server;
ESP8266HTTPUpdateServer m_updateServer;
HSDConfig& m_config;
const HSDLeds& m_leds;
const HSDMqtt& m_mqtt;
unsigned long m_deviceUptimeMinutes;
const HSDHtmlHelper m_html;
};