From 07161caa844d958a0de70c3c875c3fb970485847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20K=C3=B6pp?= Date: Sat, 28 Mar 2026 18:47:15 +0100 Subject: [PATCH] Fix Typo: "Wheather" to "Weather" * `struct CurrentWeatherData` * `struct ForecastHourWeatherData` * `struct ForecastDayWeatherData` * `struct ForecastDayWeatherDataWithDescription` --- src/BaseWeatherChannel.cpp | 8 ++++---- src/BaseWeatherChannel.h | 16 ++++++++-------- src/OpenMeteoChannel.cpp | 6 +++--- src/OpenMeteoChannel.h | 8 ++++---- src/OpenWeatherMapChannel.cpp | 10 +++++----- src/OpenWeatherMapChannel.h | 10 +++++----- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/BaseWeatherChannel.cpp b/src/BaseWeatherChannel.cpp index ab0e6a5..ebd5375 100644 --- a/src/BaseWeatherChannel.cpp +++ b/src/BaseWeatherChannel.cpp @@ -169,9 +169,9 @@ void BaseWeatherChannel::setValueCompare(uint goNumber, const KNXValue& value, c void BaseWeatherChannel::fetchData() { - CurrentWheatherData current = CurrentWheatherData(); - ForecastHourWheatherData hour1 = ForecastHourWheatherData(); - ForecastHourWheatherData hour2 = ForecastHourWheatherData(); + CurrentWeatherData current = CurrentWeatherData(); + ForecastHourWeatherData hour1 = ForecastHourWeatherData(); + ForecastHourWeatherData hour2 = ForecastHourWeatherData(); int16_t httpStatus = fillWeather(current, _today, _tomorrow, hour1, hour2); KoIW_CHHTTPStatus.value(httpStatus, DPT_Value_2_Count); @@ -307,7 +307,7 @@ void BaseWeatherChannel::fetchData() } } -void BaseWeatherChannel::updateDayForecastKo(ForecastDayWheatherDataWithDescription& fd, int koOffset) +void BaseWeatherChannel::updateDayForecastKo(ForecastDayWeatherDataWithDescription& fd, int koOffset) { logIndentUp(); logDebugP("Description: %s", fd.description); diff --git a/src/BaseWeatherChannel.h b/src/BaseWeatherChannel.h index fa0514c..2d969e9 100644 --- a/src/BaseWeatherChannel.h +++ b/src/BaseWeatherChannel.h @@ -21,7 +21,7 @@ #define IW_KoOffset_Forecast (IW_KoCHForecastDescription - IW_KoCHTodayDescription) -struct CurrentWheatherData +struct CurrentWeatherData { float temperature_C = 0; float temperatureFeelsLike_C = 0; @@ -36,7 +36,7 @@ struct CurrentWheatherData uint8_t cloudsCover_percent = 0; }; -struct ForecastHourWheatherData +struct ForecastHourWeatherData { float temperature_C = 0; float temperatureFeelsLike_C = 0; @@ -53,7 +53,7 @@ struct ForecastHourWheatherData }; -struct ForecastDayWheatherData +struct ForecastDayWeatherData { float temperatureMin_C = 0; float temperatureMax_C = 0; @@ -79,7 +79,7 @@ struct ForecastDayWheatherData uint8_t cloudsCover_percent = 0; }; -struct ForecastDayWheatherDataWithDescription : ForecastDayWheatherData +struct ForecastDayWeatherDataWithDescription : ForecastDayWeatherData { char description[15] = {0}; }; @@ -91,15 +91,15 @@ class BaseWeatherChannel : public OpenKNX::Channel unsigned long _lastApiCall = 0; unsigned long _updateIntervalInMs = 0; bool _available = false; - ForecastDayWheatherDataWithDescription _today = ForecastDayWheatherDataWithDescription(); - ForecastDayWheatherDataWithDescription _tomorrow = ForecastDayWheatherDataWithDescription(); + ForecastDayWeatherDataWithDescription _today = ForecastDayWeatherDataWithDescription(); + ForecastDayWeatherDataWithDescription _tomorrow = ForecastDayWeatherDataWithDescription(); void buildDescription(char* description, float rain, float snow, uint8_t clouds, const char* prefix); - void updateDayForecastKo(ForecastDayWheatherDataWithDescription& day, int koOffset); + void updateDayForecastKo(ForecastDayWeatherDataWithDescription& day, int koOffset); void fetchData(); protected: BaseWeatherChannel(uint8_t index); - virtual int16_t fillWeather(CurrentWheatherData& currentWeather, ForecastDayWheatherData& todayWeather, ForecastDayWheatherData& tomorrowWeather, ForecastHourWheatherData& hour1Weather, ForecastHourWheatherData& hour2Weather) = 0; + virtual int16_t fillWeather(CurrentWeatherData& currentWeather, ForecastDayWeatherData& todayWeather, ForecastDayWeatherData& tomorrowWeather, ForecastHourWeatherData& hour1Weather, ForecastHourWeatherData& hour2Weather) = 0; void setValueCompare(GroupObject& groupObject, const KNXValue& value, const Dpt& type); void setValueCompare(uint goNumber, const KNXValue& value, const Dpt& type); diff --git a/src/OpenMeteoChannel.cpp b/src/OpenMeteoChannel.cpp index 56f8857..279598d 100644 --- a/src/OpenMeteoChannel.cpp +++ b/src/OpenMeteoChannel.cpp @@ -172,7 +172,7 @@ int16_t OpenMeteoChannel::fillWeather(CurrentWheatherData& currentWeather, Forec return httpStatus; } -void OpenMeteoChannel::fillForecast(JsonObject& json, CurrentWheatherData& wheater) +void OpenMeteoChannel::fillForecast(JsonObject& json, CurrentWeatherData& wheater) { wheater.temperature_C = json["temperature_2m"]; wheater.temperatureFeelsLike_C = json["apparent_temperature"]; @@ -193,7 +193,7 @@ void OpenMeteoChannel::fillForecast(JsonObject& json, CurrentWheatherData& wheat // * Weather Code [0..100] - see end of https://open-meteo.com/en/docs } -void OpenMeteoChannel::fillForecast(JsonObject& json, int vi, ForecastHourWheatherData& wheater) +void OpenMeteoChannel::fillForecast(JsonObject& json, int vi, ForecastHourWeatherData& wheater) { // same as for current, but value-arrays instead of values wheater.temperature_C = json["temperature_2m"][vi]; @@ -221,7 +221,7 @@ float OpenMeteoChannel::avg(JsonArray& arr, int begin, int n) return sum / n; } -void OpenMeteoChannel::fillForecast(JsonObject& json, JsonObject& jsonHourly, int vi, ForecastDayWheatherData& wheater) +void OpenMeteoChannel::fillForecast(JsonObject& json, JsonObject& jsonHourly, int vi, ForecastDayWeatherData& wheater) { const int vih = 24 * vi; const int vihNight = vih + 0; diff --git a/src/OpenMeteoChannel.h b/src/OpenMeteoChannel.h index 1cbe99a..2231563 100644 --- a/src/OpenMeteoChannel.h +++ b/src/OpenMeteoChannel.h @@ -5,12 +5,12 @@ class OpenMeteoChannel : public BaseWeatherChannel { private: float avg(JsonArray& arr, int begin, int n); - void fillForecast(JsonObject& json, JsonObject& jsonHourly, int vi, ForecastDayWheatherData& wheater); - void fillForecast(JsonObject& json, CurrentWheatherData& wheater); - void fillForecast(JsonObject& json, int vi, ForecastHourWheatherData& wheater); + void fillForecast(JsonObject& json, JsonObject& jsonHourly, int vi, ForecastDayWeatherData& wheater); + void fillForecast(JsonObject& json, CurrentWeatherData& wheater); + void fillForecast(JsonObject& json, int vi, ForecastHourWeatherData& wheater); protected: - int16_t fillWeather(CurrentWheatherData& currentWeather, ForecastDayWheatherData& todayWeather, ForecastDayWheatherData& tomorrowWeather, ForecastHourWheatherData& hour1Weather, ForecastHourWheatherData& hour2Weather) override; + int16_t fillWeather(CurrentWeatherData& currentWeather, ForecastDayWeatherData& todayWeather, ForecastDayWeatherData& tomorrowWeather, ForecastHourWeatherData& hour1Weather, ForecastHourWeatherData& hour2Weather) override; public: OpenMeteoChannel(uint8_t index); diff --git a/src/OpenWeatherMapChannel.cpp b/src/OpenWeatherMapChannel.cpp index 61e92ce..ef95422 100644 --- a/src/OpenWeatherMapChannel.cpp +++ b/src/OpenWeatherMapChannel.cpp @@ -15,7 +15,7 @@ const std::string OpenWeatherMapChannel::name() return "OpenWeatherMap"; } -int16_t OpenWeatherMapChannel::fillWeather(CurrentWheatherData& currentWeather, ForecastDayWheatherData& todayWeather, ForecastDayWheatherData& tomorrowWeather, ForecastHourWheatherData& hour1Weather, ForecastHourWheatherData& hour2Weather) +int16_t OpenWeatherMapChannel::fillWeather(CurrentWeatherData& currentWeather, ForecastDayWeatherData& todayWeather, ForecastDayWeatherData& tomorrowWeather, ForecastHourWeatherData& hour1Weather, ForecastHourWeatherData& hour2Weather) { String url = OpenWeatherMapUrl; url += "&appid="; @@ -61,7 +61,7 @@ int16_t OpenWeatherMapChannel::fillWeather(CurrentWheatherData& currentWeather, return httpStatus; } -void OpenWeatherMapChannel::fillForecast(JsonObject& json, CurrentWheatherData& wheater) +void OpenWeatherMapChannel::fillForecast(JsonObject& json, CurrentWeatherData& wheater) { wheater.temperature_C = json["temp"]; // 22.34 wheater.temperatureFeelsLike_C = json["feels_like"]; // 21.95 @@ -78,13 +78,13 @@ void OpenWeatherMapChannel::fillForecast(JsonObject& json, CurrentWheatherData& wheater.cloudsCover_percent = json["clouds"]; // 40 } -void OpenWeatherMapChannel::fillForecast(JsonObject& json, ForecastHourWheatherData& wheater) +void OpenWeatherMapChannel::fillForecast(JsonObject& json, ForecastHourWeatherData& wheater) { - fillForecast(json, (CurrentWheatherData&) wheater); + fillForecast(json, (CurrentWeatherData&) wheater); wheater.probabilityOfPrecipitation_percent = round(100. * (float) json["pop"]); // 0.70 } -void OpenWeatherMapChannel::fillForecast(JsonObject& json, ForecastDayWheatherData& wheater) +void OpenWeatherMapChannel::fillForecast(JsonObject& json, ForecastDayWeatherData& wheater) { JsonObject tempObject = json["temp"]; wheater.temperatureDay_C = tempObject["day"]; // 21.95 diff --git a/src/OpenWeatherMapChannel.h b/src/OpenWeatherMapChannel.h index c1a04e7..eaa845b 100644 --- a/src/OpenWeatherMapChannel.h +++ b/src/OpenWeatherMapChannel.h @@ -5,12 +5,12 @@ class OpenWeatherMapChannel : public BaseWeatherChannel { private: - void fillForecast(JsonObject& json, ForecastDayWheatherData& wheater); - void fillForecast(JsonObject& json, CurrentWheatherData& wheater); - void fillForecast(JsonObject& json, ForecastHourWheatherData& wheater); + void fillForecast(JsonObject& json, ForecastDayWeatherData& wheater); + void fillForecast(JsonObject& json, CurrentWeatherData& wheater); + void fillForecast(JsonObject& json, ForecastHourWeatherData& wheater); protected: - int16_t fillWeather(CurrentWheatherData& currentWeather, ForecastDayWheatherData& todayWeather, ForecastDayWheatherData& tomorrowWeather, ForecastHourWheatherData& hour1Weather, ForecastHourWheatherData& hour2Weather) override; - + int16_t fillWeather(CurrentWeatherData& currentWeather, ForecastDayWeatherData& todayWeather, ForecastDayWeatherData& tomorrowWeather, ForecastHourWeatherData& hour1Weather, ForecastHourWeatherData& hour2Weather) override; + public: OpenWeatherMapChannel(uint8_t index); const std::string name() override;