diff options
Diffstat (limited to 'src/components/ble')
| -rw-r--r-- | src/components/ble/SimpleWeatherService.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/ble/SimpleWeatherService.h b/src/components/ble/SimpleWeatherService.h index 0f8c181b..469b571a 100644 --- a/src/components/ble/SimpleWeatherService.h +++ b/src/components/ble/SimpleWeatherService.h @@ -32,6 +32,8 @@ #undef min #include "components/datetime/DateTimeController.h" +#include <lvgl/lvgl.h> +#include "displayapp/InfiniTimeTheme.h" int WeatherCallback(uint16_t connHandle, uint16_t attrHandle, struct ble_gatt_access_ctxt* ctxt, void* arg); @@ -82,6 +84,18 @@ namespace Pinetime { return (PreciseFahrenheit() + 50) / 100; } + [[nodiscard]] lv_color_t Color() const { + int16_t celsius = Celsius(); + if (celsius <= 0) { // freezing + return Colors::blue; + } else if (celsius <= 4) { // ice + return LV_COLOR_CYAN; + } else if (celsius >= 27) { // hot + return Colors::deepOrange; + } + return Colors::orange; // normal + } + bool operator==(const Temperature& other) const { return raw == other.raw; } |
