Fancy up the scroll

This commit is contained in:
Tomislav Kopić 2024-11-07 21:05:20 +01:00
parent e8e16bdb8b
commit 32689e6f35

View File

@ -194,8 +194,10 @@ bool fetchWeatherData() {
DynamicJsonDocument doc(1024); DynamicJsonDocument doc(1024);
if (!deserializeJson(doc, payload)) { if (!deserializeJson(doc, payload)) {
weatherState = doc["weather"][0]["description"].as<String>(); String mainWeather = doc["weather"][0]["main"].as<String>();
capitalizeFirstLetter(const_cast<char*>(weatherState.c_str())); String description = doc["weather"][0]["description"].as<String>();
capitalizeFirstLetter(const_cast<char*>(description.c_str()));
weatherState = mainWeather + " " + description;
temperature = doc["main"]["temp"].as<float>() - 273.15; temperature = doc["main"]["temp"].as<float>() - 273.15;
humidity = doc["main"]["humidity"]; humidity = doc["main"]["humidity"];
pressure = doc["main"]["pressure"].as<float>() / 1000; pressure = doc["main"]["pressure"].as<float>() / 1000;