From d4aff5cbc4550c366c311196aa4b199f710bcc55 Mon Sep 17 00:00:00 2001 From: Alexis Delage Date: Sun, 2 Aug 2026 18:47:06 +0200 Subject: [PATCH] fix: MeteoFranceCondition mapping to WeatherCondition The fix is based on the official icons corresponding to each code, and also on my own experience using both WeatherMaster and MeteoFrance official app --- .../meteofrance/MeteoFranceConditionMap.kt | 29 +++++++------- .../sources/weather/meteofrance/README.md | 38 +++++++++++++++++++ 2 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/README.md diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/MeteoFranceConditionMap.kt b/app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/MeteoFranceConditionMap.kt index 8c5627dad..8b5f662ab 100644 --- a/app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/MeteoFranceConditionMap.kt +++ b/app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/MeteoFranceConditionMap.kt @@ -17,15 +17,11 @@ object MeteoFranceConditionMap { startsWith("p33") || startsWith("p34") -> WeatherCondition.CLEAR_SKY // TODO: SHOULD BE WIND - startsWith("p31") -> WeatherCondition.NO_CONDITION_FOUND // What is this? (I have no idea either) - startsWith("p26") || - startsWith("p27") || - startsWith("p28") || - startsWith("p29") -> WeatherCondition.THUNDERSTORM + startsWith("p23") || + startsWith("p31") -> WeatherCondition.HEAVY_SNOW startsWith("p21") || - startsWith("p22") || - startsWith("p23") -> WeatherCondition.SNOW + startsWith("p22") -> WeatherCondition.LIGHT_SNOW startsWith("p19") || startsWith("p20") -> WeatherCondition.SNOW // TODO: SHOULD BE HAIL @@ -36,26 +32,31 @@ object MeteoFranceConditionMap { startsWith("p16") || startsWith("p24") || startsWith("p25") || + startsWith("p26") || + startsWith("p27") || + startsWith("p28") || + startsWith("p29") || startsWith("p30") -> WeatherCondition.THUNDERSTORM + startsWith("p14") || + startsWith("p15") -> WeatherCondition.HEAVY_RAIN + startsWith("p9") || startsWith("p10") || startsWith("p11") || startsWith("p12") || - startsWith("p13") || - startsWith("p14") || - startsWith("p15") -> WeatherCondition.RAIN + startsWith("p13") -> WeatherCondition.LIGHT_RAIN - startsWith("p6") || + startsWith("p5") || + startsWith("p6") || startsWith("p7") || startsWith("p8") -> WeatherCondition.FOG_HAZE - startsWith("p4") || - startsWith("p5") -> WeatherCondition.FOG_HAZE - + startsWith("p4") -> WeatherCondition.MOSTLY_CLEAR startsWith("p3") -> WeatherCondition.OVERCAST startsWith("p2") -> WeatherCondition.PARTLY_CLOUDY startsWith("p1") -> WeatherCondition.CLEAR_SKY + else -> WeatherCondition.NO_CONDITION_FOUND } } diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/README.md b/app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/README.md new file mode 100644 index 000000000..92ea3e319 --- /dev/null +++ b/app/src/main/java/com/pranshulgg/weather_master_app/core/network/sources/weather/meteofrance/README.md @@ -0,0 +1,38 @@ +# Icon mappings for MeteoFrance API + +| Icon | Preview | Plausible description (no official docs) | +|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------| +| p1 | ![p1](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p1j.svg) ![p1](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p1n.svg) | Sunny / clear sky | +| p2 | ![p2](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p2j.svg) ![p2](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p2n.svg) | Partly cloudy | +| p3 | ![p3](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p3j.svg) ![p3](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p3n.svg) | Very cloudy / overcast | +| p4 | ![p4](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p4j.svg) ![p4](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p4n.svg) | Mostly clear sky | +| p5 | ![p5](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p5j.svg) ![p5](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p5n.svg) | Mist | +| p6 | ![p6](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p6j.svg) ![p6](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p6n.svg) | Mist / patchy fog banks | +| p7 | ![p7](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p7j.svg) ![p7](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p7n.svg) | Fog | +| p8 | ![p8](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p8j.svg) ![p8](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p8n.svg) | Freezing fog | +| p9 | ![p9](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p9j.svg) ![p9](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p9n.svg) | Drizzle | +| p10 | ![p10](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p10j.svg) ![p10](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p10n.svg) | Light rain | +| p11 | ![p11](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p11j.svg) ![p11](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p11n.svg) | Moderate rain | +| p12 | ![p12](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p12j.svg) ![p12](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p12n.svg) | Rare/occasional showers | +| p13 | ![p13](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p13j.svg) ![p13](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p13n.svg) | Scattered rain | +| p14 | ![p14](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p14j.svg) ![p14](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p14n.svg) | Rain | +| p15 | ![p15](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p15j.svg) ![p15](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p15n.svg) | Heavy rain | +| p16 | ![p16](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p16j.svg) ![p16](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p16n.svg) | Stormy rain | +| p17 | ![p17](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p17j.svg) ![p17](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p17n.svg) | Rain and snow mixed | +| p18 | ![p18](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p18j.svg) ![p18](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p18n.svg) | Freezing rain / icy rain | +| p19 | ![p19](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p19j.svg) ![p19](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p19n.svg) | Risk of hail | +| p20 | ![p20](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p20j.svg) ![p20](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p20n.svg) | Hail showers | +| p21 | ![p21](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p21j.svg) ![p21](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p21n.svg) | A few snow flurries | +| p22 | ![p22](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p22j.svg) ![p22](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p22n.svg) | Light snow | +| p23 | ![p23](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p23j.svg) ![p23](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p23n.svg) | Heavy snow | +| p24 | ![p24](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p24j.svg) ![p24](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p24n.svg) | Risk of hail | +| p25 | ![p25](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p25j.svg) ![p25](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p25n.svg) | Risk of hail | +| p26 | ![p26](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p26j.svg) ![p26](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p26n.svg) | Risk of thunderstorms | +| p27 | ![p27](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p27j.svg) ![p27](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p27n.svg) | Risk of thunderstorms | +| p28 | ![p28](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p28j.svg) ![p28](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p28n.svg) | Thunderstorms | +| p29 | ![p29](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p29j.svg) ![p29](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p29n.svg) | Thunderstorm with hail | +| p30 | ![p30](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p30j.svg) ![p30](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p30n.svg) | Stormy showers | +| p31 | ![p31](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p31j.svg) ![p31](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p31n.svg) | Snow storm (not obvious, but written in the SVG code) | +| p32 | ![p32](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p32j.svg) ![p32](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p32n.svg) | Strong wind | +| p33 | ![p33](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p33j.svg) ![p33](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p33n.svg) | Violent wind | +| p34 | ![p34](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p34j.svg) ![p34](https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p34n.svg) | Gale / windstorm | \ No newline at end of file