Skip to content

Commit 06c4b4d

Browse files
committed
fix retain
1 parent 1789518 commit 06c4b4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app_config.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,10 @@ config_save_mqtt(bool enable, int protocol, String server, uint16_t port, String
341341
if(!reject_unauthorized) {
342342
newflags |= CONFIG_MQTT_ALLOW_ANY_CERT;
343343
}
344-
newflags |= protocol << 4;
344+
if (retained) {
345345
newflags |= CONFIG_MQTT_RETAINED;
346+
}
347+
newflags |= protocol << 4;
346348

347349
config.set("mqtt_server", server);
348350
config.set("mqtt_port", port);

0 commit comments

Comments
 (0)