first commit
This commit is contained in:
27
ESP32_WAVESHARE_7x5/Energy.cpp
Normal file
27
ESP32_WAVESHARE_7x5/Energy.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "Energy.h"
|
||||
#include "common_functions.h"
|
||||
|
||||
Energy::Energy(Ecran * _ecran, Connect * _connect, String _host, String _port)
|
||||
{
|
||||
host = _host;
|
||||
port = _port;
|
||||
connect = _connect;
|
||||
ecran = _ecran;
|
||||
}
|
||||
|
||||
|
||||
void Energy::loadLinky(int idx[], String horizon)
|
||||
{
|
||||
if (debug) Serial.println("B - loadLinky ");
|
||||
|
||||
for (int i=0; i <= ARRAY_SIZE(idx); i++) {
|
||||
String bearer = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOlsiMTQ4OTg1NTI3OTMzOTciXSwiZXhwIjoxNzk1NTQ3MjgxLCJpYXQiOjE3MDExOTg0ODF9.l1kWoiJLFXsN9YUAaxn7Sy0PvtFiFt5spjF1E_deu_E";
|
||||
String uri = "/api/daily_consumption?prm=14898552793397&start=2023-11-01&end=2023-11-28";
|
||||
|
||||
String json1 = connect->callJson(host, port, uri, bearer);
|
||||
float result[24];
|
||||
convertJsonToArray(result, json1, "interval_reading", "value");
|
||||
if (debug) Serial.println(" loadLinky json=" + json1);
|
||||
}
|
||||
if (debug) Serial.println("E - loadLinky ");
|
||||
}
|
||||
Reference in New Issue
Block a user