From dbce980de12f798d82976b960d36456cc95f44aa Mon Sep 17 00:00:00 2001 From: JustScott Date: Mon, 5 Feb 2024 15:35:40 -0600 Subject: [PATCH] Pass the value for the weather condition variable directly instead of defining it first. changed the 'you have mail' to '[1]+ Notify, to better align with terminal lore. Use `IsCharging` instead of `IsPowerPresent` to stop displaying the 'Charging' text once the battery's full. Update the return values for weather condition in `GetSimpleCondition` to match the standard names used in the rest of the project. --- src/displayapp/screens/WatchFaceTerminal.cpp | 7 +++---- src/displayapp/screens/WatchFaceTerminal.h | 1 - src/displayapp/screens/WeatherSymbols.cpp | 16 ++++++++-------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index bc55099904..53c0da4439 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -100,7 +100,7 @@ void WatchFaceTerminal::Refresh() { notificationState = notificationManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { if (notificationState.Get()) { - lv_label_set_text_static(notificationIcon, "You have mail."); + lv_label_set_text_static(notificationIcon, "[1]+ Notify"); } else { lv_label_set_text_static(notificationIcon, ""); } @@ -144,11 +144,10 @@ void WatchFaceTerminal::Refresh() { char tempUnit = 'C'; lv_obj_set_style_local_text_color(weather, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, temperatureColor(temp)); if (settingsController.GetWeatherFormat() == Controllers::Settings::WeatherFormat::Imperial) { - condition = Symbols::GetSimpleCondition(optCurrentWeather->iconId); temp = Controllers::SimpleWeatherService::CelsiusToFahrenheit(temp); tempUnit = 'F'; } - lv_label_set_text_fmt(weather, "#ffffff [WTHR]# %i°%c %s ", temp / 100, tempUnit, condition); + lv_label_set_text_fmt(weather, "#ffffff [WTHR]# %i°%c %s ", temp / 100, tempUnit, Symbols::GetSimpleCondition(optCurrentWeather->iconId)); } else { lv_label_set_text(weather, "#ffffff [WTHR]# ---"); lv_obj_set_style_local_text_color(weather, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray); @@ -165,7 +164,7 @@ void WatchFaceTerminal::Refresh() { uint8_t hue = batteryPercentRemaining.Get() * 120 / 100; lv_obj_set_style_local_text_color(batteryValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hsv_to_rgb(hue, 100, 100)); lv_label_set_text_fmt(batteryValue, "#ffffff [BATT]# %d%%", batteryPercentRemaining.Get()); - if (batteryController.IsPowerPresent()) { + if (batteryController.IsCharging()) { lv_label_ins_text(batteryValue, LV_LABEL_POS_LAST, " Charging"); } } diff --git a/src/displayapp/screens/WatchFaceTerminal.h b/src/displayapp/screens/WatchFaceTerminal.h index d45c94c685..682f2ec5dc 100644 --- a/src/displayapp/screens/WatchFaceTerminal.h +++ b/src/displayapp/screens/WatchFaceTerminal.h @@ -50,7 +50,6 @@ namespace Pinetime { using days = std::chrono::duration>; // TODO: days is standard in c++20 Utility::DirtyValue> currentDate; Utility::DirtyValue> currentWeather {}; - Utility::DirtyValue condition {}; lv_obj_t* notificationIcon; lv_obj_t* label_prompt_1; diff --git a/src/displayapp/screens/WeatherSymbols.cpp b/src/displayapp/screens/WeatherSymbols.cpp index d18c508a02..2f3535d318 100644 --- a/src/displayapp/screens/WeatherSymbols.cpp +++ b/src/displayapp/screens/WeatherSymbols.cpp @@ -40,21 +40,21 @@ const char* Pinetime::Applications::Screens::Symbols::GetSimpleCondition(const P case Pinetime::Controllers::SimpleWeatherService::Icons::Sun: return "Clear"; case Pinetime::Controllers::SimpleWeatherService::Icons::CloudsSun: - return "Cloudy"; + return "Clouds"; case Pinetime::Controllers::SimpleWeatherService::Icons::Clouds: - return "Cloudy"; + return "Clouds"; case Pinetime::Controllers::SimpleWeatherService::Icons::BrokenClouds: - return "Cloudy"; + return "Clouds"; case Pinetime::Controllers::SimpleWeatherService::Icons::CloudShowerHeavy: - return "Rainy"; + return "Rain"; case Pinetime::Controllers::SimpleWeatherService::Icons::CloudSunRain: - return "Rainy"; + return "Drizzle"; case Pinetime::Controllers::SimpleWeatherService::Icons::Thunderstorm: - return "Stormy"; + return "Thunder"; case Pinetime::Controllers::SimpleWeatherService::Icons::Snow: - return "Snowy"; + return "Snow"; case Pinetime::Controllers::SimpleWeatherService::Icons::Smog: - return "Misty"; + return "Mist"; default: return ""; }