diff options
author | Avamander <avamander@gmail.com> | 2021-12-01 23:45:01 +0200 |
---|---|---|
committer | Avamander <avamander@gmail.com> | 2021-12-04 22:03:40 +0200 |
commit | 154e3d27ad0053edf09db6437264028cbca8afd1 (patch) | |
tree | 89c709a45ab806aa66245593d4b2d3d18b68861b /src/components/ble/weather/WeatherService.h | |
parent | 797b60397c630ac93dcff1bf7cef268c20747fb3 (diff) |
Added a few helper functions
Diffstat (limited to 'src/components/ble/weather/WeatherService.h')
-rw-r--r-- | src/components/ble/weather/WeatherService.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/components/ble/weather/WeatherService.h b/src/components/ble/weather/WeatherService.h index cc1a4b0d..52b0356a 100644 --- a/src/components/ble/weather/WeatherService.h +++ b/src/components/ble/weather/WeatherService.h @@ -61,6 +61,17 @@ namespace Pinetime { std::unique_ptr<WeatherData::Pressure>& GetCurrentPressure(); std::unique_ptr<WeatherData::AirQuality>& GetCurrentQuality(); + /** + * Searches for the current day's maximum temperature + * @return -32768 if there's no data, degrees celcius times 100 otherwise + */ + int16_t getTodayMaxTemp() const; + /** + * Searches for the current day's minimum temperature + * @return -32768 if there's no data, degrees celcius times 100 otherwise + */ + int16_t getTodayMinTemp() const; + /* * Management functions */ @@ -75,7 +86,6 @@ namespace Pinetime { size_t GetTimelineLength() const; /** * Checks if an event of a certain type exists in the timeline - * @return */ bool HasTimelineEventOfType(WeatherData::eventtype type) const; @@ -124,6 +134,8 @@ namespace Pinetime { Pinetime::Controllers::DateTime& dateTimeController; std::vector<std::unique_ptr<WeatherData::TimelineHeader>> timeline; + std::unique_ptr<WeatherData::TimelineHeader> nullTimelineheader = std::make_unique<WeatherData::TimelineHeader>(); + std::unique_ptr<WeatherData::TimelineHeader>* nullHeader; /** * Cleans up the timeline of expired events @@ -149,9 +161,6 @@ namespace Pinetime { * @return if the event is valid */ static bool isEventStillValid(const std::unique_ptr<WeatherData::TimelineHeader>& uniquePtr, const uint64_t timestamp); - - std::unique_ptr<WeatherData::TimelineHeader> nullTimelineheader = std::make_unique<WeatherData::TimelineHeader>(); - std::unique_ptr<WeatherData::TimelineHeader>* nullHeader; }; } } |