fix: stop treating rainfall total as current rain

This commit is contained in:
zv
2026-06-02 15:10:37 +02:00
parent ce2e1176fa
commit 352287bc38
8 changed files with 11 additions and 39 deletions

View File

@@ -160,7 +160,6 @@ export function getWindDirection(degrees: number) {
export function getWeatherMoodFromData(station: SynopStation, date = new Date()): WeatherMood {
const hour = date.getHours();
if ((station.rainfall ?? 0) >= 0.1) return "rain";
if (hour < 6 || hour >= 21) return "night";
if ((station.windSpeed ?? 0) >= 8) return "wind";
if ((station.temperature ?? 15) <= 3) return "cold";
@@ -170,8 +169,6 @@ export function getWeatherMoodFromData(station: SynopStation, date = new Date())
}
export function getWeatherDescription(station: SynopStation, language: Language = "pl") {
if ((station.rainfall ?? 0) >= 5) return translate(language, "weather.heavyRain");
if ((station.rainfall ?? 0) >= 0.1) return translate(language, "weather.rain");
if ((station.windSpeed ?? 0) >= 8) return translate(language, "weather.strongWind");
if ((station.humidity ?? 0) >= 90) return translate(language, "weather.humid");
return translate(language, "weather.calm");
@@ -181,7 +178,6 @@ export function moodGradient(mood: WeatherMood) {
return {
warm: "from-sky-400 via-blue-500 to-indigo-700",
cloudy: "from-slate-600 via-slate-700 to-slate-900",
rain: "from-slate-600 via-blue-900 to-slate-950",
wind: "from-cyan-600 via-slate-600 to-blue-950",
cold: "from-cyan-300 via-blue-500 to-indigo-900",
night: "from-slate-800 via-indigo-950 to-slate-950",