mirror of
https://github.com/anklimov/lighthub
synced 2025-12-07 12:19:49 +03:00
Publish while MQTT connection pending caused hungs/WDT sometime - fixed
Default set 0 to all DMX out channels (include unused)
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
#include "utils.h"
|
||||
#include <aJSON.h>
|
||||
#include "inputs.h"
|
||||
#include "main.h"
|
||||
|
||||
extern lan_status lanStatus;
|
||||
extern PubSubClient mqttClient;
|
||||
|
||||
int abstractIn::publish(long value, char* subtopic)
|
||||
@@ -32,7 +34,7 @@ int abstractIn::publish(char * value, char* subtopic)
|
||||
strncpy(addrstr,emit->valuestring,sizeof(addrstr));
|
||||
if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestring);
|
||||
strncat(addrstr,subtopic,sizeof(addrstr));
|
||||
if (mqttClient.connected())
|
||||
if (mqttClient.connected() && lanStatus == OPERATION)
|
||||
{
|
||||
mqttClient.publish(addrstr, value, true);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user