Skip to content

Commit

Permalink
WatchFacePineTimeStyle: Fix conditional in weather display (#1965)
Browse files Browse the repository at this point in the history
Since returning a valid weather is always considered an updated value,
if the current weather is empty, the face will attempt to display the
temperature and icon as empty values, rather than clearing the labels.
  • Loading branch information
vkareh authored Jan 14, 2024
1 parent 0503248 commit 264b5be
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/displayapp/screens/WatchFacePineTimeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ void WatchFacePineTimeStyle::Refresh() {
}

currentWeather = weatherService.Current();

if (currentWeather.IsUpdated()) {
auto optCurrentWeather = currentWeather.Get();
if (optCurrentWeather) {
Expand All @@ -551,12 +550,10 @@ void WatchFacePineTimeStyle::Refresh() {
temp = temp / 100 + (temp % 100 >= 50 ? 1 : 0);
lv_label_set_text_fmt(temperature, "%d°", temp);
lv_label_set_text(weatherIcon, Symbols::GetSymbol(optCurrentWeather->iconId));
lv_obj_realign(temperature);
lv_obj_realign(weatherIcon);
} else {
lv_label_set_text(temperature, "--");
lv_label_set_text(weatherIcon, Symbols::ban);
}
} else {
lv_label_set_text(temperature, "--");
lv_label_set_text(weatherIcon, Symbols::ban);
lv_obj_realign(temperature);
lv_obj_realign(weatherIcon);
}
Expand Down

0 comments on commit 264b5be

Please sign in to comment.