Temperature configuration unit support shortname value c and f

This commit is contained in:
Phat Nguyen
2024-04-30 20:32:53 +07:00
parent 88808a2ad2
commit 29c1989e78

View File

@ -476,9 +476,9 @@ bool Configuration::parse(String data, bool isLocal) {
if (JSON.typeof_(root["temperatureUnit"]) == "string") {
String unit = root["temperatureUnit"];
unit.toLowerCase();
if ((unit == "c") || (unit == "celsius")) {
if (unit == "c") {
temperatureUnit = 'c';
} else if ((unit == "f") || (unit == "fahrenheit")) {
} else if (unit == "f") {
temperatureUnit = 'f';
} else {
failedMessage = "'temperatureUnit' value '" + unit + "' invalid";