From ea6d339b9ce494963062c3a69ce3034335e29427 Mon Sep 17 00:00:00 2001 From: ezcGman Date: Mon, 19 Dec 2022 22:15:39 +0100 Subject: [PATCH] UM SHT: Fixed MQTT discovery using correct unit --- usermods/sht/usermod_sht.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/sht/usermod_sht.h b/usermods/sht/usermod_sht.h index 42b22a79e..88daeb438 100644 --- a/usermods/sht/usermod_sht.h +++ b/usermods/sht/usermod_sht.h @@ -191,7 +191,7 @@ void ShtUsermod::publishHomeAssistantAutodiscovery() { json[F("stat_cla")] = F("measurement"); snprintf_P(buf, 127, PSTR("%s-temperature"), escapedMac.c_str()); json[F("uniq_id")] = buf; - json[F("unit_of_meas")] = F("°C"); + json[F("unit_of_meas")] = F((unitOfTemp ? "°F" : "°C")); appendDeviceToMqttDiscoveryMessage(json); payload_size = serializeJson(json, json_str); snprintf_P(buf, 127, PSTR("homeassistant/sensor/%s/%s-temperature/config"), escapedMac.c_str(), escapedMac.c_str());