@@ -184,7 +184,7 @@ bool getWeather(char *wstr) {
184184  const  char * host  = " api.openweathermap.org"  ;
185185
186186  if  (!client.connect (host, 80 )) {
187-     Serial.println (" ## OPENWEATHERMAP  ###: connection  failed"  );
187+     Serial.println (" ##WEATHER ###: connection  failed"  );
188188    return  false ;
189189  }
190190  char  httpget[250 ] = {0 };
@@ -193,7 +193,7 @@ bool getWeather(char *wstr) {
193193  unsigned  long  timeout = millis ();
194194  while  (client.available () == 0 ) {
195195    if  (millis () - timeout > 2000UL ) {
196-       Serial.println (" ## OPENWEATHERMAP  ###: client available timeout !"  );
196+       Serial.println (" ##WEATHER ###: client available timeout !"  );
197197      client.stop ();
198198      return  false ;
199199    }
@@ -211,13 +211,13 @@ bool getWeather(char *wstr) {
211211      if  ((millis () - timeout) > 500 )
212212      {
213213        client.stop ();
214-         Serial.println (" ## OPENWEATHERMAP  ###: client read timeout !"  );
214+         Serial.println (" ##WEATHER ###: client read timeout !"  );
215215        return  false ;
216216      }
217217    }
218218  }
219219  if  (strstr (line.c_str (), " \" temp\" "  ) == NULL ) {
220-     Serial.println (" ## OPENWEATHERMAP  ###: weather not found !"  );
220+     Serial.println (" ##WEATHER ###: weather not found !"  );
221221    return  false ;
222222  }
223223  char  *tmpe;
@@ -227,82 +227,82 @@ bool getWeather(char *wstr) {
227227  char  desc[120 ], temp[20 ], hum[20 ], press[20 ], icon[5 ];
228228
229229  tmps = strstr (cursor, " \" description\" :\" "  );
230-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: description not found !"  ); return  false ;}
230+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: description not found !"  ); return  false ;}
231231  tmps += 15 ;
232232  tmpe = strstr (tmps, " \" ,\" "  );
233-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: description not found !"  ); return  false ;}
233+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: description not found !"  ); return  false ;}
234234  strlcpy (desc, tmps, tmpe - tmps + 1 );
235235  cursor = tmpe + 2 ;
236236
237237  //  "ясно","icon":"01d"}],
238238  tmps = strstr (cursor, " \" icon\" :\" "  );
239-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: icon not found !"  ); return  false ;}
239+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: icon not found !"  ); return  false ;}
240240  tmps += 8 ;
241241  tmpe = strstr (tmps, " \" }"  );
242-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: icon not found !"  ); return  false ;}
242+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: icon not found !"  ); return  false ;}
243243  strlcpy (icon, tmps, tmpe - tmps + 1 );
244244  cursor = tmpe + 2 ;
245245
246246  tmps = strstr (cursor, " \" temp\" :"  );
247-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: temp not found !"  ); return  false ;}
247+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: temp not found !"  ); return  false ;}
248248  tmps += 7 ;
249249  tmpe = strstr (tmps, " ,\" "  );
250-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: temp not found !"  ); return  false ;}
250+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: temp not found !"  ); return  false ;}
251251  strlcpy (temp, tmps, tmpe - tmps + 1 );
252252  cursor = tmpe + 1 ;
253253  float  tempf = atof (temp);
254254
255255  tmps = strstr (cursor, " \" feels_like\" :"  );
256-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: feels_like not found !"  ); return  false ;}
256+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: feels_like not found !"  ); return  false ;}
257257  tmps += 13 ;
258258  tmpe = strstr (tmps, " ,\" "  );
259-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: feels_like not found !"  ); return  false ;}
259+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: feels_like not found !"  ); return  false ;}
260260  strlcpy (temp, tmps, tmpe - tmps + 1 );
261261  cursor = tmpe + 2 ;
262262  float  tempfl = atof (temp); (void )tempfl;
263263
264264  tmps = strstr (cursor, " \" pressure\" :"  );
265-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: pressure not found !"  ); return  false ;}
265+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: pressure not found !"  ); return  false ;}
266266  tmps += 11 ;
267267  tmpe = strstr (tmps, " ,\" "  );
268-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: pressure not found !"  ); return  false ;}
268+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: pressure not found !"  ); return  false ;}
269269  strlcpy (press, tmps, tmpe - tmps + 1 );
270270  cursor = tmpe + 2 ;
271271  int  pressi = (float )atoi (press) / 1.333 ;
272272
273273  tmps = strstr (cursor, " humidity\" :"  );
274-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: humidity not found !"  ); return  false ;}
274+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: humidity not found !"  ); return  false ;}
275275  tmps += 10 ;
276276  tmpe = strstr (tmps, " ,\" "  );
277277  tmpc = strstr (tmps, " }"  );
278-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: humidity not found !"  ); return  false ;}
278+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: humidity not found !"  ); return  false ;}
279279  strlcpy (hum, tmps, tmpe - tmps + (tmpc>tmpe?1 :0 ));
280280
281281  tmps = strstr (cursor, " \" grnd_level\" :"  );
282282  bool  grnd_level_pr = (tmps != NULL );
283283  if (grnd_level_pr){
284284    tmps += 13 ;
285285    tmpe = strstr (tmps, " ,\" "  );
286-     if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: grnd_level not found !"  ); return  false ;}
286+     if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: grnd_level not found !"  ); return  false ;}
287287    strlcpy (press, tmps, tmpe - tmps + 1 );
288288    cursor = tmpe + 2 ;
289289    pressi = (float )atoi (press) / 1.333 ;
290290  }
291291
292292  tmps = strstr (cursor, " \" speed\" :"  );
293-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: wind speed not found !"  ); return  false ;}
293+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: wind speed not found !"  ); return  false ;}
294294  tmps += 8 ;
295295  tmpe = strstr (tmps, " ,\" "  );
296-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: wind speed not found !"  ); return  false ;}
296+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: wind speed not found !"  ); return  false ;}
297297  strlcpy (temp, tmps, tmpe - tmps + 1 );
298298  cursor = tmpe + 1 ;
299299  float  wind_speed = atof (temp); (void )wind_speed;
300300
301301  tmps = strstr (cursor, " \" deg\" :"  );
302-   if  (tmps == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: wind deg not found !"  ); return  false ;}
302+   if  (tmps == NULL ) { Serial.println (" ##WEATHER ###: wind deg not found !"  ); return  false ;}
303303  tmps += 6 ;
304304  tmpe = strstr (tmps, " ,\" "  );
305-   if  (tmpe == NULL ) { Serial.println (" ## OPENWEATHERMAP  ###: wind deg not found !"  ); return  false ;}
305+   if  (tmpe == NULL ) { Serial.println (" ##WEATHER ###: wind deg not found !"  ); return  false ;}
306306  strlcpy (temp, tmps, tmpe - tmps + 1 );
307307  cursor = tmpe + 1 ;
308308  int  wind_deg = atof (temp)/22.5 ;
@@ -330,7 +330,7 @@ bool getWeather(char *wstr) {
330330    nextion.weatherVisible (1 );
331331  #endif 
332332
333-   Serial.printf (" ## OPENWEATHERMAP  ###: description: %s, temp:%.1f C, pressure:%dmmHg, humidity:%s%%\n "  , desc, tempf, pressi, hum);
333+   Serial.printf (" ##WEATHER ###: description: %s, temp:%.1f C, pressure:%dmmHg, humidity:%s%%\n "  , desc, tempf, pressi, hum);
334334  #ifdef  WEATHER_FMT_SHORT
335335  sprintf (wstr, weatherFmt, tempf, pressi, hum);
336336  #else 
0 commit comments