This repository was archived by the owner on Jan 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ void mqttConnect() {
99
99
delay (1000 );
100
100
}
101
101
Serial .println ("\nconnected!" );
102
- mqttClient -> subscribe (device -> getConfigTopic ());
103
- mqttClient -> subscribe (device -> getCommandsTopic ());
102
+ mqttClient -> subscribe (device -> getConfigTopic (), 1 ); // Set QoS to 1 (ack) for configuration messages
103
+ mqttClient -> subscribe (device -> getCommandsTopic (), 0 ); // QoS 0 (no ack) for commands
104
104
publishState ("connected" );
105
105
}
106
106
Original file line number Diff line number Diff line change @@ -125,8 +125,8 @@ void mqttConnect() {
125
125
delay (1000 );
126
126
}
127
127
Serial .println ("\nconnected!" );
128
- mqttClient -> subscribe (device -> getConfigTopic ());
129
- mqttClient -> subscribe (device -> getCommandsTopic ());
128
+ mqttClient -> subscribe (device -> getConfigTopic (), 1 ); // Set QoS to 1 (ack) for configuration messages
129
+ mqttClient -> subscribe (device -> getCommandsTopic (), 0 ); // QoS 0 (no ack) for commands
130
130
publishState ("connected" );
131
131
}
132
132
Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ void mqttConnect() {
94
94
delay (1000 );
95
95
}
96
96
Serial .println ("\nconnected!" );
97
- mqttClient -> subscribe (device -> getConfigTopic ());
98
- mqttClient -> subscribe (device -> getCommandsTopic ());
97
+ mqttClient -> subscribe (device -> getConfigTopic (), 1 ); // Set QoS to 1 (ack) for configuration messages
98
+ mqttClient -> subscribe (device -> getCommandsTopic (), 0 ); // QoS 0 (no ack) for commands
99
99
publishState ("connected" );
100
100
}
101
101
You can’t perform that action at this time.
0 commit comments