Skip to content

Commit

Permalink
pinetimestyle: Display temp in Fahrenheit with setting
Browse files Browse the repository at this point in the history
  • Loading branch information
FintasticMan committed Dec 23, 2023
1 parent 4b5dfc3 commit 2711ce3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/displayapp/screens/WatchFacePineTimeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2711ce3

Please sign in to comment.