aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Kareh <vkareh@vkareh.net>2024-01-14 16:37:26 -0500
committerGitHub <noreply@github.com>2024-01-14 22:37:26 +0100
commit264b5bed43d5a703df20c1e305f394a15e9d2484 (patch)
tree5fc8257204aba99f0a524a7d321dbe1a944f7aab
parent0503248a258d64e195c8ecbf701ea36ba1e642cb (diff)
WatchFacePineTimeStyle: Fix conditional in weather display (#1965)
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.
-rw-r--r--src/displayapp/screens/WatchFacePineTimeStyle.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
index 296323d3..e56031f7 100644
--- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp
+++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
@@ -540,7 +540,6 @@ void WatchFacePineTimeStyle::Refresh() {
}
currentWeather = weatherService.Current();
-
if (currentWeather.IsUpdated()) {
auto optCurrentWeather = currentWeather.Get();
if (optCurrentWeather) {
@@ -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);
}