From e88d0afabfd9f4abec1db94a7b2cdcc022bc4067 Mon Sep 17 00:00:00 2001 From: FintasticMan Date: Sat, 15 Jul 2023 02:33:57 +0200 Subject: [PATCH] pinetimestyle: Display temp in Fahrenheit with setting --- src/displayapp/screens/WatchFacePineTimeStyle.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp index caabbc11..68e9bcfb 100644 --- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp +++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp @@ -543,7 +543,11 @@ void WatchFacePineTimeStyle::Refresh() { if (currentWeather.IsUpdated()) { auto optCurrentWeather = currentWeather.Get(); if (optCurrentWeather) { - lv_label_set_text_fmt(temperature, "%d°", (optCurrentWeather->temperature) / 100); + int16_t temp = optCurrentWeather->temperature; + if (settingsController.GetWeatherFormat() == Controllers::Settings::WeatherFormat::Imperial) { + temp = Controllers::SimpleWeatherService::CelsiusToFahrenheit(temp); + } + lv_label_set_text_fmt(temperature, "%d°", temp / 100); lv_label_set_text(weatherIcon, Symbols::GetSymbol(optCurrentWeather->iconId)); lv_obj_realign(temperature); lv_obj_realign(weatherIcon);