Merge pull request #100 from airgradienthq/hotfix/temperature-unit-supported-shortname-value

Temperature configuration unit support shortname value `c` and `f`
This commit is contained in:
Phat Nguyen
2024-04-30 22:26:53 +07:00
committed by GitHub

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";