Skip to content

Commit 4dad7e9

Browse files
committedMar 24, 2018
Update according to Base v1.0.5
1 parent d5cfca0 commit 4dad7e9

23 files changed

+1094
-505
lines changed
 

‎Main.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef Main_h
22
#define Main_h
33

4+
#include <arduino.h>
5+
46
#include "data\status.html.gz.h"
57
#include "data\config.html.gz.h"
68
#include "data\fw.html.gz.h"
@@ -19,18 +21,16 @@
1921
//include Application header file
2022
#include "WirelessTeleInfo.h"
2123

22-
#define APPLICATION_NAME "DomoChip Wireless TeleInfo"
23-
#define APPLICATION_CLASS WebTeleInfo
24-
#define APPLICATION_VAR webTeleInfo
24+
#define APPLICATION1_NAME "WTeleInfo"
25+
#define APPLICATION1_DESC "DomoChip Wireless TeleInfo"
26+
#define APPLICATION1_CLASS WebTeleInfo
2527

2628
#define VERSION_NUMBER "3.1.1"
2729

28-
#define MODEL "WTeleInfo"
29-
3030
#define DEFAULT_AP_SSID "WirelessTeleInfo"
3131
#define DEFAULT_AP_PSK "PasswordTeleInfo"
3232

33-
//Enable developper mode (fwdev webpage and SPIFFS is used)
33+
//Enable developper mode (SPIFFS editor)
3434
#define DEVELOPPER_MODE 0
3535

3636
//Pin RX used to receive TéléInformation signal @ 1200bauds

‎WirelessTeleInfo.h

+13-28
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77

88
#include "Main.h"
99
#include "src\Utils.h"
10+
#include "src\Base.h"
1011

12+
#include <ESP8266HTTPClient.h>
1113
#include "LibTeleInfo.h"
1214

1315
const char appDataPredefPassword[] PROGMEM = "ewcXoCt4HHjZUvY1";
1416

15-
//Structure of Application Data 1
16-
class AppData1 {
17-
18-
public:
17+
class WebTeleInfo : public Application {
1918

19+
private:
2020
typedef struct {
2121
bool enabled = false;
2222
bool tls = false;
@@ -26,25 +26,6 @@ class AppData1 {
2626
} Jeedom;
2727
Jeedom jeedom;
2828

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-
4829
//for returning Status
4930
String _request;
5031
int _requestResult;
@@ -56,13 +37,17 @@ class WebTeleInfo {
5637
String GetLabel(const String &labelName);
5738
String GetAllLabel();
5839

59-
String GetStatus();
6040

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();
6149
public:
62-
WebTeleInfo();
63-
void Init(AppData1 &appData1);
64-
void InitWebServer(AsyncWebServer &server);
65-
void Run();
50+
WebTeleInfo(char appId, String appName);
6651
};
6752

6853
#endif

0 commit comments

Comments
 (0)