From cbe5980766632ec6606a5ed0dda4f5d0e29c79ca Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sat, 9 Mar 2019 23:49:10 +0300 Subject: [PATCH] fix --- lighthub/inputs.cpp | 2 +- lighthub/item.cpp | 2 +- lighthub/item.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lighthub/inputs.cpp b/lighthub/inputs.cpp index 9e43d68..c86917a 100644 --- a/lighthub/inputs.cpp +++ b/lighthub/inputs.cpp @@ -227,7 +227,7 @@ void Input::dht22Poll() { #endif aJsonObject *emit = aJson.getObjectItem(inputObj, "emit"); aJsonObject *item = aJson.getObjectItem(inputObj, "item"); - if (item) thermoSetCurTemp(item, temp); + if (item) thermoSetCurTemp(item->valuestring, temp); debugSerial << F("IN:") << pin << F(" DHT22 type. T=") << temp << F("°C H=") << humidity << F("%"); if (emit && temp && humidity && temp == temp && humidity == humidity) { char addrstr[MQTT_TOPIC_LENGTH] = ""; diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 25bf240..eae2a10 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -270,7 +270,7 @@ if (isSet) while (payload && i < 3) Par[i++] = getInt((char **) &payload); - return Ctrl(0, i, Par, send, subItem); + return Ctrl(0, i, Par, send, subItemN); } break; diff --git a/lighthub/item.h b/lighthub/item.h index a39cf62..5c52e58 100644 --- a/lighthub/item.h +++ b/lighthub/item.h @@ -79,6 +79,7 @@ e-mail anklimov@gmail.com #include "aJSON.h" extern aJsonObject *items; +extern short thermoSetCurTemp(char *name, float t); int txt2cmd (char * payload);