diff --git a/lighthub/abstractch.cpp b/lighthub/abstractch.cpp index 48f3bf8..c54238b 100644 --- a/lighthub/abstractch.cpp +++ b/lighthub/abstractch.cpp @@ -7,6 +7,7 @@ extern lan_status lanStatus; extern PubSubClient mqttClient; +extern int8_t ethernetIdleCount; int abstractCh::publishTopic(const char* topic, long value, const char* subtopic) { @@ -31,7 +32,7 @@ int abstractCh::publishTopic(const char* topic, const char * value, const char* strncpy(addrstr,topic,sizeof(addrstr)); if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,topic); strncat(addrstr,subtopic,sizeof(addrstr)); - if (mqttClient.connected() && lanStatus == OPERATION) + if (mqttClient.connected() && lanStatus == OPERATION && !ethernetIdleCount) { mqttClient.publish(addrstr, value, true); return 1; diff --git a/lighthub/inputs.cpp b/lighthub/inputs.cpp index 829d7ac..34ad5b9 100644 --- a/lighthub/inputs.cpp +++ b/lighthub/inputs.cpp @@ -852,8 +852,15 @@ void Input::analogPoll(short cause) { if (aJson.getArraySize(inputMap)==5) Noize = aJson.getArrayItem(inputMap, 4)->valueint; - if (mappedInputVal>max) mappedInputVal = max; - if (mappedInputValmax) + { + mappedInputVal = max; + inputVal = 1023; + } + if (mappedInputVal0)) { debugSerial<= thermoSetting) { - if (thermoPin<0) digitalWrite(-thermoPin, HIGH); digitalWrite(thermoPin, LOW); + if (thermoPin<0) digitalWrite(-thermoPin, HIGH); else digitalWrite(thermoPin, LOW); debugSerial< +#include #if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32) #include