Standardize MQTTDiscovery Temp Keys [deprecate tem key] (#703)
* Detect when sensor isn't available or read fails * Add temperature conversion macros * Add 'tempc' & 'tempf' keys to published values * Unique Values for HA Discovery * Remove degree symbol from temp sensors Co-authored-by: Jonathan Michael Wells <jonathan-wells@oist.jp>
This commit is contained in:
1 parent
b7a4591518
commit
4f1b49d135
10 files changed
+97
-52
No files matched your search
@@ -90,7 +90,7 @@ void MeasureAHTTempHum() {
|
||||
JsonObject& AHTx0data = jsonBuffer.createObject();
|
||||
// Generate Temperature in degrees C
|
||||
if (ahtTempC.temperature != persisted_aht_tempc || AHTx0_always) {
|
||||
float ahtTempF = (ahtTempC.temperature * 1.8) + 32;
|
||||
float ahtTempF = convertTemp_CtoF(ahtTempC.temperature);
|
||||
AHTx0data.set("tempc", (float)ahtTempC.temperature);
|
||||
AHTx0data.set("tempf", (float)ahtTempF);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user