From 3f552cecc8b6329c516c2f6c41d7ceaeb0d3052f 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp index caabbc111a..9ea005f8e2 100644 --- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp +++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp @@ -20,6 +20,7 @@ */ #include "displayapp/screens/WatchFacePineTimeStyle.h" +#include #include #include #include @@ -543,7 +544,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::WeatherService::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);