aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens/WeatherSymbols.h
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2023-12-23 16:02:32 +0100
committerJF <JF002@users.noreply.github.com>2023-12-23 21:12:25 +0100
commitad090ab1884ec71a7a5168af9fb9d5149fb11d7b (patch)
treeecad04c4cefeae17f07a9d534794cb9cd38377fb /src/displayapp/screens/WeatherSymbols.h
parentef2c43156928b659d02a4ac9412ee947d0cc4d27 (diff)
Simple Weather Service
Move the function GetIcon that converts SimpleWeatherService::Icons to char (symbol) into a new header file so that it can be used by other apps and companion apps.
Diffstat (limited to 'src/displayapp/screens/WeatherSymbols.h')
-rw-r--r--src/displayapp/screens/WeatherSymbols.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/displayapp/screens/WeatherSymbols.h b/src/displayapp/screens/WeatherSymbols.h
new file mode 100644
index 00000000..99ce3887
--- /dev/null
+++ b/src/displayapp/screens/WeatherSymbols.h
@@ -0,0 +1,46 @@
+#pragma once
+#include "components/ble/SimpleWeatherService.h"
+#include "displayapp/screens/Symbols.h"
+
+namespace Pinetime {
+ namespace Applications {
+ namespace Screens {
+ namespace Symbols {
+ const char* GetSymbol(const Pinetime::Controllers::SimpleWeatherService::Icons icon) {
+ switch (icon) {
+ case Pinetime::Controllers::SimpleWeatherService::Icons::Sun:
+ return Symbols::sun;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::CloudsSun:
+ return Symbols::cloudSun;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::Clouds:
+ return Symbols::cloud;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::BrokenClouds:
+ return Symbols::cloudMeatball;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::Thunderstorm:
+ return Symbols::bolt;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::Snow:
+ return Symbols::snowflake;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::CloudShowerHeavy:
+ return Symbols::cloudShowersHeavy;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::CloudSunRain:
+ return Symbols::cloudSunRain;
+ break;
+ case Pinetime::Controllers::SimpleWeatherService::Icons::Smog:
+ return Symbols::smog;
+ break;
+ default:
+ return Symbols::ban;
+ break;
+ }
+ }
+ }
+ }
+ }
+}