From 173981fca7bc73d33bfbe40597b684c8360f7ca6 Mon Sep 17 00:00:00 2001 From: Mit4el Date: Fri, 6 Oct 2023 20:06:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D0=BA=D0=BE=D0=BD=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/virtual/owmWeather/owmWeather.cpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/modules/virtual/owmWeather/owmWeather.cpp b/src/modules/virtual/owmWeather/owmWeather.cpp index 400be181..67e93cad 100644 --- a/src/modules/virtual/owmWeather/owmWeather.cpp +++ b/src/modules/virtual/owmWeather/owmWeather.cpp @@ -188,10 +188,32 @@ public: return; if (root == "weather") - { + { // ☔⛅❄🌤🌥🌦🌧🌨🌩🌫🌞 + String icn = Weatherdoc1[root][0]["icon"].as(); + if (icn == "01d" || icn == "01n") + icn = "🌞"; + else if (icn == "02d" || icn == "02n") + icn = "🌤"; + else if (icn == "03d" || icn == "03n") + icn = "🌥"; + else if (icn == "04d" || icn == "04n") + icn = "🌫"; + else if (icn == "09d" || icn == "09n") + icn = "🌧"; + else if (icn == "10d" || icn == "10n") + icn = "🌦"; + else if (icn == "11d" || icn == "11n") + icn = "🌩"; + else if (icn == "13d" || icn == "13n") + icn = "❄"; + else + icn = ""; if (Weatherdoc1[root][0][param].as() != tmp->value.valS) { - tmp->setValue(Weatherdoc1[root][0][param].as(), true); + if (param == "description") + tmp->setValue(Weatherdoc1[root][0][param].as() + icn, true); + else + tmp->setValue(Weatherdoc1[root][0][param].as(), true); } } else if (root == "")