[DISC] Set "retain":false within autodiscovery messages for Home Assistant and OpenHAB discovery switch. (#1814)

As discovery state is stored in flash memory and there is an auto off timer,
we don't want discovery turned back on by a retained MQTT message when device
reboots.
This commit is contained in:
Ian Taylor
2023-11-21 03:49:04 -07:00
committed by GitHub
parent 87b26c867f
commit fb42293631

View File

@@ -502,7 +502,7 @@ void pubMqttDiscovery() {
"{\"discovery\":true,\"save\":true}", "{\"discovery\":false,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain,
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain,
stateClassNone, //State Class
"false", "true" //state_off, state_on
);
@@ -512,7 +512,7 @@ void pubMqttDiscovery() {
"{\"ohdiscovery\":true,\"save\":true}", "{\"ohdiscovery\":false,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain,
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain,
stateClassNone, //State Class
"false", "true" //state_off, state_on
);