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") { if (JSON.typeof_(root["temperatureUnit"]) == "string") {
String unit = root["temperatureUnit"]; String unit = root["temperatureUnit"];
unit.toLowerCase(); unit.toLowerCase();
if ((unit == "c") || (unit == "celsius")) { if (unit == "c") {
temperatureUnit = 'c'; temperatureUnit = 'c';
} else if ((unit == "f") || (unit == "fahrenheit")) { } else if (unit == "f") {
temperatureUnit = 'f'; temperatureUnit = 'f';
} else { } else {
failedMessage = "'temperatureUnit' value '" + unit + "' invalid"; failedMessage = "'temperatureUnit' value '" + unit + "' invalid";