This commit is contained in:
e2002
2022-10-31 10:15:17 +03:00
parent bfb6cd822a
commit ef14938dbe
33 changed files with 1860 additions and 176 deletions

View File

@@ -209,6 +209,7 @@ bool getWeather(char *wstr) {
}
char *tmpe;
char *tmps;
char *tmpc;
const char* cursor = line.c_str();
char desc[120], temp[20], hum[20], press[20], icon[5];
@@ -251,8 +252,9 @@ bool getWeather(char *wstr) {
if (tmps == NULL) { Serial.println("## OPENWEATHERMAP ###: humidity not found !"); return false;}
tmps += 10;
tmpe = strstr(tmps, ",\"");
tmpc = strstr(tmps, "}");
if (tmpe == NULL) { Serial.println("## OPENWEATHERMAP ###: humidity not found !"); return false;}
strlcpy(hum, tmps, tmpe - tmps + 1);
strlcpy(hum, tmps, tmpe - tmps + (tmpc>tmpe?1:0));
#ifdef USE_NEXTION
nextion.putcmdf("press_txt.txt=\"%dmm\"", pressi);