From 72c1c538cf354ad159c44aced8e1792a873e0903 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 13 Aug 2019 18:44:59 +0200 Subject: [PATCH] mqtt: only parse json --- src/main.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 363389b..52524df 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -424,27 +424,6 @@ void receiveMqtt(const char* topic, const char* data, int data_len) { ESP_LOGI(TAG, "got new values from %s, timestamp: %lu", topic, sensor->lastUpdate); ESP_LOGI(TAG, "%lu seconds ago", topic, getTimestamp() - sensor->lastUpdate); } - } else if (strcmp("/temperature", topic_last) == 0) { - sensor->temperature = atof(data); - sensor->lastUpdate = getTimestamp(); - } else if (strcmp("/humidity", topic_last) == 0) { - sensor->humidity = atof(data); - } else if (strcmp("/pressure", topic_last) == 0) { - sensor->pressure = atof(data); - } else if (strcmp("/pm10", topic_last) == 0) { - sensor->pm10 = atof(data); - } else if (strcmp("/pm25", topic_last) == 0) { - sensor->pm25 = atof(data); - } else if (strcmp("/lux", topic_last) == 0) { - sensor->lux = atof(data); - } else if (strcmp("/uvi", topic_last) == 0) { - sensor->uvi = atof(data); - } else if (strcmp("/uva", topic_last) == 0) { - sensor->uva = atof(data); - } else if (strcmp("/uvb", topic_last) == 0) { - sensor->uvb = atof(data); - } else if (strcmp("/voc", topic_last) == 0) { - sensor->voc = atof(data); } } }