aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens/WatchFacePineTimeStyle.h
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2023-12-09 20:39:08 +0100
committerJF <JF002@users.noreply.github.com>2023-12-23 21:12:25 +0100
commitc94a59e7d3e0f9929171263412033a56872c168a (patch)
treef9e3d4c1915b91f57ff8d96b18e10f0fbb998aa4 /src/displayapp/screens/WatchFacePineTimeStyle.h
parent088082d32db483ac5326bed09d5d47847fb5bf9b (diff)
SimpleWeather service : new weather implementation
This new implementation of the weather feature provides a new BLE API and a new weather service. The API uses a single characteristic that allows companion apps to write the weather conditions (current and forecast for the next 5 days). The SimpleWeather service exposes those data as std::optional fields. This new implementation replaces the previous WeahterService. The API is documented in docs/SimpleWeatherService.md.
Diffstat (limited to 'src/displayapp/screens/WatchFacePineTimeStyle.h')
-rw-r--r--src/displayapp/screens/WatchFacePineTimeStyle.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.h b/src/displayapp/screens/WatchFacePineTimeStyle.h
index dd079fed..72537095 100644
--- a/src/displayapp/screens/WatchFacePineTimeStyle.h
+++ b/src/displayapp/screens/WatchFacePineTimeStyle.h
@@ -9,7 +9,7 @@
#include "displayapp/screens/BatteryIcon.h"
#include "displayapp/Colors.h"
#include "components/datetime/DateTimeController.h"
-#include "components/ble/weather/WeatherService.h"
+#include "components/ble/SimpleWeatherService.h"
#include "components/ble/BleController.h"
#include "utility/DirtyValue.h"
@@ -33,7 +33,7 @@ namespace Pinetime {
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::MotionController& motionController,
- Controllers::WeatherService& weather);
+ Controllers::SimpleWeatherService& weather);
~WatchFacePineTimeStyle() override;
bool OnTouchEvent(TouchEvents event) override;
@@ -61,9 +61,7 @@ namespace Pinetime {
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {};
Utility::DirtyValue<uint32_t> stepCount {};
Utility::DirtyValue<bool> notificationState {};
- Utility::DirtyValue<int16_t> nowTemp {};
- int16_t clouds = 0;
- int16_t precip = 0;
+ Utility::DirtyValue<std::optional<Pinetime::Controllers::SimpleWeatherService::CurrentWeather>> currentWeather {};
static Pinetime::Controllers::Settings::Colors GetNext(Controllers::Settings::Colors color);
static Pinetime::Controllers::Settings::Colors GetPrevious(Controllers::Settings::Colors color);
@@ -114,7 +112,7 @@ namespace Pinetime {
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;
Controllers::MotionController& motionController;
- Controllers::WeatherService& weatherService;
+ Controllers::SimpleWeatherService& weatherService;
void SetBatteryIcon();
void CloseMenu();