From e6c5c5e6443345e019549d8b41ffa0c19d050c9f Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 17 Sep 2026 09:00:40 +0200 Subject: feat: parse the cached OWM response Lua patterns instead of a JSON library: the current-weather response is flat and known, so six scalars do not justify a dependency. Every failure path (truncated write, empty file, garbage, an API error body, nil input) returns nil rather than raising, since a Lua error here is a blank dashboard. Co-Authored-By: Claude Opus 5 --- test/fixtures/weather.json | 1 + test/fixtures/weather_truncated.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/fixtures/weather.json create mode 100644 test/fixtures/weather_truncated.json (limited to 'test/fixtures') diff --git a/test/fixtures/weather.json b/test/fixtures/weather.json new file mode 100644 index 0000000..12493b0 --- /dev/null +++ b/test/fixtures/weather.json @@ -0,0 +1 @@ +{"coord":{"lon":11.0,"lat":45.0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"base":"stations","main":{"temp":18.34,"feels_like":18.11,"temp_min":16.67,"temp_max":19.44,"pressure":1014,"humidity":72},"visibility":10000,"wind":{"speed":4.12,"deg":230},"clouds":{"all":75},"dt":1789625000,"sys":{"type":2,"id":2004688,"country":"XX","sunrise":1789600000,"sunset":1789646000},"timezone":7200,"id":1,"name":"Example City","cod":200} diff --git a/test/fixtures/weather_truncated.json b/test/fixtures/weather_truncated.json new file mode 100644 index 0000000..eb0099a --- /dev/null +++ b/test/fixtures/weather_truncated.json @@ -0,0 +1 @@ +{"coord":{"lon":11.0,"lat":45.0},"weather":[{"id":501,"main":"Rain","descrip -- cgit v1.2.3