83 lines
1.6 KiB
C++
83 lines
1.6 KiB
C++
#ifndef ServeurWeb_h
|
|
#define ServeurWeb_h
|
|
|
|
#include <Arduino.h>
|
|
#include <ESP8266WiFi.h>
|
|
#include "Domoticz.h"
|
|
#include "Params.h"
|
|
#include "Modules.h"
|
|
#include "Pins.h"
|
|
#define PAGE_MENU 0
|
|
#define PAGE_ADMIN 1
|
|
#define PAGE_STATUS 2
|
|
#define PAGE_INFOS 3
|
|
#define PAGE_GRAPH 4
|
|
#define DELAI_LECTURE 120
|
|
|
|
|
|
class ServeurWeb
|
|
{
|
|
public:
|
|
ServeurWeb();
|
|
//void setup();
|
|
void loop();
|
|
private:
|
|
boolean connectToWifi();
|
|
//void initHardware();
|
|
char* convertToChar(String s, char* buf);
|
|
void infos();
|
|
void menuBody(int page);
|
|
void pageAdmin();
|
|
void pageMenu(int page);
|
|
void printWifiStatus();
|
|
//void setupWiFi();
|
|
void body();
|
|
String getValueFrom(String request, int deb, int fin);
|
|
void menuStyle(int page);
|
|
void style();
|
|
void graph();
|
|
|
|
public:
|
|
Domoticz* domoticz;
|
|
Modules* modules;
|
|
// WiFiClient _client;
|
|
String radiateur = ""; //"217";
|
|
String temp = ""; //"281";
|
|
String cons = ""; //"212";
|
|
|
|
String jsPath = "/ESP8266/js/";
|
|
String jqueryName = "jquery.js";
|
|
String chartName = "chart.js";
|
|
String AP_NameString = "";
|
|
int nbData = 0;
|
|
String data = "22.3,22.3,22.3,22.3";
|
|
String labels = "0,1,2,3";
|
|
int bcl = 0;
|
|
int val0;
|
|
int val2;
|
|
int val3;
|
|
int val4;
|
|
String separator = ",";
|
|
String nom = "";
|
|
int refresh = 2;
|
|
WiFiClient client;
|
|
WiFiServer* server;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Ordre dans Domoticz
|
|
// // Radiateur Temp Consigne
|
|
// //Manon 217 281 212
|
|
// //Théo 219 335 211
|
|
// //Chambre 218 254 213
|
|
// //Bureau 163 260 214
|
|
|
|
|