mirror of
https://github.com/anklimov/lighthub
synced 2025-12-07 12:19:49 +03:00
channels abstraction changed
This commit is contained in:
@@ -31,14 +31,7 @@ int abstractIn::publish(char * value, char* subtopic)
|
||||
aJsonObject *emit = aJson.getObjectItem(in->inputObj, "emit");
|
||||
if (emit)
|
||||
{
|
||||
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() && lanStatus == OPERATION)
|
||||
{
|
||||
mqttClient.publish(addrstr, value, true);
|
||||
return 1;
|
||||
}
|
||||
return publish(emit->valuestring,value,subtopic);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user