diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-08-13 11:24:01 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-08-13 11:26:00 +0200 |
commit | 36d5d0b86965751f2e824158ebd19fe9619fa2dc (patch) | |
tree | 1a4663e983cfe13c7fb98a675673b78ea5bc2598 | |
parent | 3b1384e8c1bfb199f87bf56e3f0ec0a062178b68 (diff) |
feat: add all weather icons
-rw-r--r-- | app/Sensor.hs | 119 |
1 files changed, 118 insertions, 1 deletions
diff --git a/app/Sensor.hs b/app/Sensor.hs index edd41c3..0b1ab0a 100644 --- a/app/Sensor.hs +++ b/app/Sensor.hs @@ -459,11 +459,128 @@ weatherForecast = do symbol = P.pretty ( case summary.symbol_code of - "partlycloudy_night" -> "\xe37e" + -- sunny + "clearsky_day" -> nfMdWeatherSunny + "clearsky_night" -> nfMdWeatherSunny + "clearsky_polartwilight" -> nfMdWeatherSunny + -- cloudy + "cloudy" -> nfMdWeatherCloudy + -- partly cloudy + "fair_day" -> nfMdWeatherPartlyCloudy + "fair_night" -> nfMdWeatherPartlyCloudy + "fair_polartwilight" -> nfMdWeatherPartlyCloudy + "partlycloudy_day" -> nfMdWeatherPartlyCloudy + "partlycloudy_night" -> nfMdWeatherPartlyCloudy + "partlycloudy_polartwilight" -> nfMdWeatherPartlyCloudy + -- fog + "fog" -> nfMdWeatherFog + -- rain + "rain" -> nfMdWeatherRainy + "lightrain" -> nfMdWeatherRainy + "heavyrain" -> nfMdWeatherPouring + -- snow + "snow" -> nfMdWeatherSnowy + "lightsnow" -> nfMdWeatherSnowy + "heavysnow" -> nfMdWeatherSnowyHeavy + -- sleet + "sleet" -> nfMdWeatherHail + "lightsleet" -> nfMdWeatherSnowyRainy + "heavysleet" -> nfMdWeatherHail + -- thunder + -- rain + thunder + "rainandthunder" -> nfMdWeatherLightning + "lightrainandthunder" -> nfMdWeatherLightning + "heavyrainandthunder" -> nfMdWeatherLightning + -- sleet + thunder + "sleetandthunder" -> nfMdWeatherLightning + "lightsleetandthunder" -> nfMdWeatherLightning + "heavysleetandthunder" -> nfMdWeatherLightning + -- snow + thunder + "snowandthunder" -> nfMdWeatherLightning + "lightsnowandthunder" -> nfMdWeatherLightning + "heavysnowandthunder" -> nfMdWeatherLightning + -- SHOWERS, map to "partly" + -- rain + "rainshowers_day" -> nfMdWeatherPartlyRainy + "rainshowers_night" -> nfMdWeatherPartlyRainy + "rainshowers_polartwilight" -> nfMdWeatherPartlyRainy + "lightrainshowers_day" -> nfMdWeatherPartlyRainy + "lightrainshowers_night" -> nfMdWeatherPartlyRainy + "lightrainshowers_polartwilight" -> nfMdWeatherPartlyRainy + "heavyrainshowers_day" -> nfMdWeatherPartlyRainy + "heavyrainshowers_night" -> nfMdWeatherPartlyRainy + "heavyrainshowers_polartwilight" -> nfMdWeatherPartlyRainy + -- snow + "snowshowers_day" -> nfMdWeatherPartlySnowy + "snowshowers_night" -> nfMdWeatherPartlySnowy + "snowshowers_polartwilight" -> nfMdWeatherPartlySnowy + "lightsnowshowers_day" -> nfMdWeatherPartlySnowy + "lightsnowshowers_night" -> nfMdWeatherPartlySnowy + "lightsnowshowers_polartwilight" -> nfMdWeatherPartlySnowy + "heavysnowshowers_day" -> nfMdWeatherPartlySnowy + "heavysnowshowers_night" -> nfMdWeatherPartlySnowy + "heavysnowshowers_polartwilight" -> nfMdWeatherPartlySnowy + -- sleet + "sleetshowers_day" -> nfMdWeatherPartlySnowyRainy + "sleetshowers_night" -> nfMdWeatherPartlySnowyRainy + "sleetshowers_polartwilight" -> nfMdWeatherPartlySnowyRainy + "heavysleetshowers_day" -> nfMdWeatherPartlySnowyRainy + "heavysleetshowers_night" -> nfMdWeatherPartlySnowyRainy + "heavysleetshowers_polartwilight" -> nfMdWeatherPartlySnowyRainy + "lightsleetshowers_day" -> nfMdWeatherPartlySnowyRainy + "lightsleetshowers_night" -> nfMdWeatherPartlySnowyRainy + "lightsleetshowers_polartwilight" -> nfMdWeatherPartlySnowyRainy + -- thunder + -- rain + thunder + "rainshowersandthunder_day" -> nfMdWeatherPartlyLightning + "rainshowersandthunder_night" -> nfMdWeatherPartlyLightning + "rainshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + "lightrainshowersandthunder_day" -> nfMdWeatherPartlyLightning + "lightrainshowersandthunder_night" -> nfMdWeatherPartlyLightning + "lightrainshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + "heavyrainshowersandthunder_day" -> nfMdWeatherPartlyLightning + "heavyrainshowersandthunder_night" -> nfMdWeatherPartlyLightning + "heavyrainshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + -- snow + thunder + "snowshowersandthunder_day" -> nfMdWeatherPartlyLightning + "snowshowersandthunder_night" -> nfMdWeatherPartlyLightning + "snowshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + "lightssnowshowersandthunder_day" -> nfMdWeatherPartlyLightning + "lightssnowshowersandthunder_night" -> nfMdWeatherPartlyLightning + "lightssnowshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + "heavysnowshowersandthunder_day" -> nfMdWeatherPartlyLightning + "heavysnowshowersandthunder_night" -> nfMdWeatherPartlyLightning + "heavysnowshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + -- sleet + thunder + "sleetshowersandthunder_day" -> nfMdWeatherPartlyLightning + "sleetshowersandthunder_night" -> nfMdWeatherPartlyLightning + "sleetshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + "lightssleetshowersandthunder_day" -> nfMdWeatherPartlyLightning + "lightssleetshowersandthunder_night" -> nfMdWeatherPartlyLightning + "lightssleetshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning + "heavysleetshowersandthunder_day" -> nfMdWeatherPartlyLightning + "heavysleetshowersandthunder_night" -> nfMdWeatherPartlyLightning + "heavysleetshowersandthunder_polartwilight" -> nfMdWeatherPartlyLightning _ -> summary.symbol_code ) tempMax = P.color P.Red (P.pretty (show details.air_temperature_max)) tempMin = P.color P.Green (P.pretty (show details.air_temperature_min)) + + nfMdWeatherCloudy = "\xf0590" + nfMdWeatherFog = "\xf0591" + nfMdWeatherHail = "\xf0592" + nfMdWeatherLightning = "\xf0593" + nfMdWeatherPartlyCloudy = "\xf0595" + nfMdWeatherPartlyLightning = "\xf0f32" + nfMdWeatherPartlyRainy = "\xf0f33" + nfMdWeatherPartlySnowyRainy = "\xf0f35" + nfMdWeatherPartlySnowy = "\xf0f34" + nfMdWeatherPouring = "\xf0596" + nfMdWeatherRainy = "\xf0597" + nfMdWeatherSnowyHeavy = "\xf0f36" + nfMdWeatherSnowyRainy = "\xf067f" + nfMdWeatherSnowy = "\xf0598" + nfMdWeatherSunny = "\xf0599" ) data Location = Location deriving (Show) |