Merge remote-tracking branch 'origin/master' into feat/balance

This commit is contained in:
2023-04-25 10:59:11 +02:00
270 changed files with 24664 additions and 10 deletions

View File

@ -40,9 +40,7 @@ public:
* @return false il y a une erreur durran l'envoie
*/
bool sendValue(String val, String poubelleID, String unit, bool full);
private:
/**
* @brief connect l'utilisateur a l'api et met a jour le token
*
@ -51,6 +49,11 @@ private:
*/
bool connect();
//TODO :: Check wifibegin avant
private:
/**
* @brief ID de l'utilisateur
*

View File

@ -59,7 +59,8 @@ bool API::connect(){
this->client->println();
while (!client->available()) {}
while (!client->available()) {
}
String responce = "";
while (client->available()) {
@ -77,7 +78,10 @@ bool API::connect(){
this->client->stop();
sortie = true;
if (JSONVar::stringify(JSONVar::parse(str)["code"]) == "400") {
Serial.println("Failed to authenticate");
return false;
}
return sortie;
}