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 45bd91c commit 3f552ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/displayapp/screens/WatchFacePineTimeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "displayapp/screens/WatchFacePineTimeStyle.h"
#include <components/ble/weather/WeatherService.h>
#include <lvgl/lvgl.h>
#include <cstdio>
#include <displayapp/Colors.h>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3f552ce

Please sign in to comment.