7
7
8
8
#include " Main.h"
9
9
#include " src\Utils.h"
10
+ #include " src\Base.h"
10
11
12
+ #include < ESP8266HTTPClient.h>
11
13
#include " LibTeleInfo.h"
12
14
13
15
const char appDataPredefPassword[] PROGMEM = " ewcXoCt4HHjZUvY1" ;
14
16
15
- // Structure of Application Data 1
16
- class AppData1 {
17
-
18
- public:
17
+ class WebTeleInfo : public Application {
19
18
19
+ private:
20
20
typedef struct {
21
21
bool enabled = false ;
22
22
bool tls = false ;
@@ -26,25 +26,6 @@ class AppData1 {
26
26
} Jeedom;
27
27
Jeedom jeedom;
28
28
29
- void SetDefaultValues () {
30
-
31
- jeedom.enabled = false ;
32
- jeedom.tls = true ;
33
- jeedom.hostname [0 ] = 0 ;
34
- jeedom.apiKey [0 ] = 0 ;
35
- memset (jeedom.fingerPrint , 0 , 20 );
36
- }
37
-
38
- String GetJSON ();
39
- bool SetFromParameters (AsyncWebServerRequest* request, AppData1 &tempAppData);
40
- };
41
-
42
-
43
- class WebTeleInfo {
44
-
45
- private:
46
- AppData1* _appData1;
47
-
48
29
// for returning Status
49
30
String _request;
50
31
int _requestResult;
@@ -56,13 +37,17 @@ class WebTeleInfo {
56
37
String GetLabel (const String &labelName);
57
38
String GetAllLabel ();
58
39
59
- String GetStatus ();
60
40
41
+ void SetConfigDefaultValues ();
42
+ void ParseConfigJSON (JsonObject &root);
43
+ bool ParseConfigWebRequest (AsyncWebServerRequest *request);
44
+ String GenerateConfigJSON (bool forSaveFile);
45
+ String GenerateStatusJSON ();
46
+ bool AppInit (bool reInit);
47
+ void AppInitWebServer (AsyncWebServer &server, bool &shouldReboot, bool &pauseApplication);
48
+ void AppRun ();
61
49
public:
62
- WebTeleInfo ();
63
- void Init (AppData1 &appData1);
64
- void InitWebServer (AsyncWebServer &server);
65
- void Run ();
50
+ WebTeleInfo (char appId, String appName);
66
51
};
67
52
68
53
#endif
0 commit comments