diff options
| author | Victor Kareh <vkareh@redhat.com> | 2024-01-23 17:39:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 23:39:28 +0100 |
| commit | 2135e12b338b651f3c3ed4511428d68b9727e6f6 (patch) | |
| tree | 82688ec63bd1b5e15d3fd1c0515b75c072d2a262 /src/displayapp/screens/WatchFaceDigital.h | |
| parent | a6cd3679eb1219865a215d0600c9703b198f9157 (diff) | |
WatchFaceDigital: Add weather display
If weather is available, display the cloud icon and temperature.
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.h')
| -rw-r--r-- | src/displayapp/screens/WatchFaceDigital.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index a4664792..3ff78c8a 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -6,6 +6,7 @@ #include <memory> #include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" +#include "components/ble/SimpleWeatherService.h" #include "components/ble/BleController.h" #include "displayapp/widgets/StatusIcons.h" #include "utility/DirtyValue.h" @@ -32,7 +33,8 @@ namespace Pinetime { Controllers::NotificationManager& notificationManager, Controllers::Settings& settingsController, Controllers::HeartRateController& heartRateController, - Controllers::MotionController& motionController); + Controllers::MotionController& motionController, + Controllers::SimpleWeatherService& weather); ~WatchFaceDigital() override; void Refresh() override; @@ -50,6 +52,8 @@ namespace Pinetime { Utility::DirtyValue<uint8_t> heartbeat {}; Utility::DirtyValue<bool> heartbeatRunning {}; Utility::DirtyValue<bool> notificationState {}; + Utility::DirtyValue<std::optional<Pinetime::Controllers::SimpleWeatherService::CurrentWeather>> currentWeather {}; + using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20 Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate; @@ -61,12 +65,15 @@ namespace Pinetime { lv_obj_t* stepIcon; lv_obj_t* stepValue; lv_obj_t* notificationIcon; + lv_obj_t* weatherIcon; + lv_obj_t* temperature; Controllers::DateTime& dateTimeController; Controllers::NotificationManager& notificationManager; Controllers::Settings& settingsController; Controllers::HeartRateController& heartRateController; Controllers::MotionController& motionController; + Controllers::SimpleWeatherService& weatherService; lv_task_t* taskRefresh; Widgets::StatusIcons statusIcons; @@ -85,7 +92,8 @@ namespace Pinetime { controllers.notificationManager, controllers.settingsController, controllers.heartRateController, - controllers.motionController); + controllers.motionController, + *controllers.weatherController); }; static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) { |
