feat: add check if wifi connected

This commit is contained in:
2023-08-11 20:57:50 +02:00
parent 908ca96c39
commit 46d3edef1d
3 changed files with 11 additions and 9 deletions

View File

@ -11,8 +11,9 @@ DiscordAPI::DiscordAPI(String hookUrl){
bool DiscordAPI::sendMessage(String message){
bool sortie = true;
//TODO: faire test si le wifi est bien connecter
if(WiFi.status() != WL_CONNECTED){
return false;
}
this->httpClient->begin(*this->wifiClient, this->hookUrl);
this->httpClient->addHeader("Content-Type", "application/json");
@ -25,4 +26,4 @@ bool DiscordAPI::sendMessage(String message){
}
this->httpClient->end();
return sortie;
}
}