diff --git a/src/utils/weather/openmeteo-condition-map.js b/src/utils/weather/openmeteo-condition-map.js index 9ae673657..30117fc5c 100644 --- a/src/utils/weather/openmeteo-condition-map.js +++ b/src/utils/weather/openmeteo-condition-map.js @@ -139,22 +139,22 @@ const conditions = [ { code: 80, icon: { - day: Icons.WiDaySnow, - night: Icons.WiNightAltSnow, + day: Icons.WiDaySprinkle, + night: Icons.WiNightAltSprinkle, }, }, { code: 81, icon: { - day: Icons.WiDaySnow, - night: Icons.WiNightAltSnow, + day: Icons.WiDayShowers, + night: Icons.WiNightAltShowers, }, }, { code: 82, icon: { - day: Icons.WiDaySnow, - night: Icons.WiNightAltSnow, + day: Icons.WiDayStormShowers, + night: Icons.WiNightAltStormShowers, }, }, { diff --git a/src/utils/weather/openmeteo-condition-map.test.js b/src/utils/weather/openmeteo-condition-map.test.js index 40e301e67..4cc4356f3 100644 --- a/src/utils/weather/openmeteo-condition-map.test.js +++ b/src/utils/weather/openmeteo-condition-map.test.js @@ -9,6 +9,25 @@ describe("utils/weather/openmeteo-condition-map", () => { expect(mapIcon(95, "night")).toBe(Icons.WiNightAltThunderstorm); }); + it("maps rain shower and snow codes correctly", () => { + [80].forEach((code) => { + expect(mapIcon(code, "day")).toBe(Icons.WiDaySprinkle); + expect(mapIcon(code, "night")).toBe(Icons.WiNightAltSprinkle); + }); + [81].forEach((code) => { + expect(mapIcon(code, "day")).toBe(Icons.WiDayShowers); + expect(mapIcon(code, "night")).toBe(Icons.WiNightAltShowers); + }); + [82].forEach((code) => { + expect(mapIcon(code, "day")).toBe(Icons.WiDayStormShowers); + expect(mapIcon(code, "night")).toBe(Icons.WiNightAltStormShowers); + }); + [85, 86].forEach((code) => { + expect(mapIcon(code, "day")).toBe(Icons.WiDaySnow); + expect(mapIcon(code, "night")).toBe(Icons.WiNightAltSnow); + }); + }); + it("falls back to a default icon for unknown codes", () => { expect(mapIcon(999999, "day")).toBe(Icons.WiDaySunny); });