Fix for MQTT topic for temperature F.

This commit is contained in:
Blaz Kristan 2021-05-03 22:50:55 +02:00
parent de7da8b26e
commit ce6b5105c6

View File

@ -165,7 +165,7 @@ class UsermodTemperature : public Usermod {
// reading the sensor
strcat_P(subuf, PSTR("/temperature"));
mqtt->publish(subuf, 0, true, String(temperature).c_str());
strcat_P(subuf, PSTR("/temperature_f"));
strcat_P(subuf, PSTR("_f"));
mqtt->publish(subuf, 0, true, String((float)temperature * 1.8f + 32).c_str());
} else {
// publish something else to indicate status?