Removed "retain" from MQTT messages.

This commit is contained in:
Blaz Kristan
2021-05-14 20:57:56 +02:00
parent 9a5917a331
commit f6a5bc9b40
4 changed files with 25 additions and 26 deletions

View File

@@ -162,9 +162,9 @@ class UsermodTemperature : public Usermod {
// the DallasTemperature library returns -127C or -196.6F when problem
// reading the sensor
strcat_P(subuf, PSTR("/temperature"));
mqtt->publish(subuf, 0, true, String(temperature).c_str());
mqtt->publish(subuf, 0, false, String(temperature).c_str());
strcat_P(subuf, PSTR("_f"));
mqtt->publish(subuf, 0, true, String((float)temperature * 1.8f + 32).c_str());
mqtt->publish(subuf, 0, false, String((float)temperature * 1.8f + 32).c_str());
} else {
// publish something else to indicate status?
}