first commit

This commit is contained in:
Jérôme Delacotte
2025-03-06 11:15:32 +01:00
commit 7b30d6e298
5276 changed files with 2108927 additions and 0 deletions

View 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 ");
}