fix temp/hum empty check in sync with recent updates

pull/191/head
Hansi, dl9rdz 2021-09-22 13:50:18 +02:00
rodzic b297a9a7c7
commit cb5b3584d0
3 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -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;

Wyświetl plik

@ -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;