From 29ad09f4ef54126831d36fe1b99e794059fc5421 Mon Sep 17 00:00:00 2001 From: FintasticMan Date: Tue, 20 Feb 2024 11:25:02 +0100 Subject: weather: Refactor temperature type for type safety There is now a Temperature struct in the weather service, which holds the internal representation. There is also a temperature struct in the Applications namespace, which holds the temperature in either Celsius or Fahrenheit. --- src/displayapp/Weather.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/displayapp/Weather.h (limited to 'src/displayapp/Weather.h') diff --git a/src/displayapp/Weather.h b/src/displayapp/Weather.h new file mode 100644 index 00000000..0dd17fce --- /dev/null +++ b/src/displayapp/Weather.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include + +#include "components/ble/SimpleWeatherService.h" +#include "components/settings/Settings.h" + +namespace Pinetime { + namespace Applications { + struct Temperature { + int16_t temp; + }; + + Temperature Convert(Controllers::SimpleWeatherService::Temperature temp, Controllers::Settings::WeatherFormat format); + } +} -- cgit v1.2.3-70-g09d2