-
Notifications
You must be signed in to change notification settings - Fork 7
/
HSDHtmlHelper.hpp
44 lines (31 loc) · 1.37 KB
/
HSDHtmlHelper.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
#pragma once
#include <Arduino.h>
#include "HSDConfig.hpp"
#include <ESP8266WebServer.h>
class HSDHtmlHelper
{
public:
HSDHtmlHelper();
String getHeader(const char* title, const char* host, const char* version) const;
String getFooter() const;
String getColorMappingTableHeader() const;
String getColorMappingTableEntry(int entryNum, const HSDConfig::ColorMapping* mapping) const;
String getColorMappingTableFooter() const;
String getColorMappingTableAddEntryForm(int newEntryNum, bool isFull) const;
String getDeviceMappingTableHeader() const;
String getDeviceMappingTableEntry(int entryNum, const HSDConfig::DeviceMapping* mapping) const;
String getDeviceMappingTableFooter() const;
String getDeviceMappingTableAddEntryForm(int newEntryNum, bool isFull) const;
String getDeleteForm() const;
String getSaveForm() const;
String minutes2Uptime(unsigned long minutes) const;
String ip2String(IPAddress ip) const;
String color2htmlColor(HSDConfig::Color color) const;
String behavior2String(HSDConfig::Behavior behavior) const;
String color2String(HSDConfig::Color color) const;
private:
String getColorOptions(HSDConfig::Color selectedColor) const;
String getBehaviorOptions(HSDConfig::Behavior selectedBehavior) const;
String getTypeOptions(HSDConfig::deviceType selectedType) const;
String type2String(HSDConfig::deviceType type) const;
};