Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzosciacca committed Dec 16, 2023
1 parent c3c5608 commit 2b262df
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/apps/_experiments/OswAppWeather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ String WeatherParser::encodeWeather(DynamicJsonDocument& doc) {
update.weather = this->_getWCond(doc["list"][i]["weather"][0]["id"]);
res = encoder.setUpdate(update);
if (!res) {
OSW_LOG_I(i);
OSW_LOG_I("content");
OSW_LOG_I(doc["list"][i]["main"]);
OSW_LOG_I("ERROR_INPUT" );
return "ERROR_INPUT" ;
}
}
Expand Down Expand Up @@ -298,6 +296,7 @@ bool OswAppWeather::_request() {
OswServiceAllTasks::wifi.disconnectWiFi();
OSW_LOG_I("Request returned code: ", code);
if (code == 200) {
DynamicJsonDocument doc(16432);
deserializeJson(doc,http.getStream());
WeatherParser pars;
String encoded = pars.encodeWeather(doc);
Expand All @@ -323,7 +322,7 @@ bool OswAppWeather::_request() {
return true;
} else {
this->dataLoaded = false;
return false;6
return false;
}

}
Expand Down

0 comments on commit 2b262df

Please sign in to comment.