mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +00:00
Subcribe to group topics in native app
This commit is contained in:
parent
c582df6550
commit
6520b001c3
@ -84,7 +84,7 @@ bool mqttHAautodiscover = true;
|
||||
#define MQTT_NODENAME "";
|
||||
#endif
|
||||
#ifndef MQTT_GROUPNAME
|
||||
#define MQTT_GROUPNAME "";
|
||||
#define MQTT_GROUPNAME "plates";
|
||||
#endif
|
||||
|
||||
#ifndef MQTT_PREFIX
|
||||
@ -258,14 +258,19 @@ static void onConnect(void* context)
|
||||
{
|
||||
MQTTClient client = (MQTTClient)context;
|
||||
connected = 1;
|
||||
std::string topic;
|
||||
|
||||
LOG_VERBOSE(TAG_MQTT, "Successful connection");
|
||||
|
||||
std::string topic;
|
||||
topic = mqttGroupTopic + "command/#";
|
||||
mqtt_subscribe(mqtt_client, topic.c_str());
|
||||
|
||||
topic = mqttNodeTopic + "command/#";
|
||||
mqtt_subscribe(mqtt_client, topic.c_str());
|
||||
|
||||
topic = mqttGroupTopic + "config/#";
|
||||
mqtt_subscribe(mqtt_client, topic.c_str());
|
||||
|
||||
topic = mqttNodeTopic + "config/#";
|
||||
mqtt_subscribe(mqtt_client, topic.c_str());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user