pinetimestyle: Display temp in Fahrenheit with setting
This commit is contained in:
parent
d889f3e444
commit
e88d0afabf
|
@ -543,7 +543,11 @@ void WatchFacePineTimeStyle::Refresh() {
|
||||||
if (currentWeather.IsUpdated()) {
|
if (currentWeather.IsUpdated()) {
|
||||||
auto optCurrentWeather = currentWeather.Get();
|
auto optCurrentWeather = currentWeather.Get();
|
||||||
if (optCurrentWeather) {
|
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_label_set_text(weatherIcon, Symbols::GetSymbol(optCurrentWeather->iconId));
|
||||||
lv_obj_realign(temperature);
|
lv_obj_realign(temperature);
|
||||||
lv_obj_realign(weatherIcon);
|
lv_obj_realign(weatherIcon);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user