kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
fix temp/hum empty check in sync with recent updates
rodzic
b297a9a7c7
commit
cb5b3584d0
|
@ -3717,14 +3717,14 @@ void sondehub_send_data(WiFiClient * client, SondeInfo * s, struct st_sondehub *
|
|||
}
|
||||
|
||||
// Only send temp if provided
|
||||
if ((int)s->d.temperature != 0) {
|
||||
sprintf(w, "\"temp\": %.1f,", float(s->d.temperature));
|
||||
if (!isnan(s->d.temperature)) {
|
||||
sprintf(w, "\"temp\": %.1f,", s->d.temperature);
|
||||
w += strlen(w);
|
||||
}
|
||||
|
||||
// Only send humidity if provided
|
||||
if ((int)s->d.relativeHumidity != 0) {
|
||||
sprintf(w, "\"humidity\": %.1f,", float(s->d.relativeHumidity));
|
||||
if (!isnan(s->d.relativeHumidity)) {
|
||||
sprintf(w, "\"humidity\": %.1f,", s->d.relativeHumidity);
|
||||
w += strlen(w);
|
||||
}
|
||||
|
||||
|
|
|
@ -79,10 +79,12 @@ void Sonde::defaultConfig() {
|
|||
Serial.printf("Board fingerprint is %d\n", fingerprint);
|
||||
|
||||
sondeList = (SondeInfo *)malloc((MAXSONDE+1)*sizeof(SondeInfo));
|
||||
// addSonde should initialize everything anyway, so this should not strictly be necessary, but does no harm either
|
||||
memset(sondeList, 0, (MAXSONDE+1)*sizeof(SondeInfo));
|
||||
for(int i=0; i<(MAXSONDE+1); i++) {
|
||||
sondeList[i].freq=400;
|
||||
sondeList[i].type=STYPE_RS41;
|
||||
clearAllData(&sondeList[i]);
|
||||
}
|
||||
config.touch_thresh = 70;
|
||||
config.led_pout = -1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const char *version_name = "rdzTTGOsonde";
|
||||
const char *version_id = "devel20210921";
|
||||
const char *version_id = "devel20210922";
|
||||
const int SPIFFS_MAJOR=2;
|
||||
const int SPIFFS_MINOR=16;
|
||||
|
|
Ładowanie…
Reference in New Issue