diff options
Diffstat (limited to 'lib/weather.lua')
| -rw-r--r-- | lib/weather.lua | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/weather.lua b/lib/weather.lua index 3cb7b64..28b3341 100644 --- a/lib/weather.lua +++ b/lib/weather.lua @@ -59,24 +59,6 @@ function M.icon(code, is_day) return I.unknown end -local DESCRIBE = { - [0] = 'Clear sky', [1] = 'Mainly clear', [2] = 'Partly cloudy', [3] = 'Overcast', - [45] = 'Fog', [48] = 'Rime fog', - [51] = 'Light drizzle', [53] = 'Drizzle', [55] = 'Dense drizzle', - [56] = 'Freezing drizzle', [57] = 'Freezing drizzle', - [61] = 'Light rain', [63] = 'Rain', [65] = 'Heavy rain', - [66] = 'Freezing rain', [67] = 'Freezing rain', - [71] = 'Light snow', [73] = 'Snow', [75] = 'Heavy snow', [77] = 'Snow grains', - [80] = 'Rain showers', [81] = 'Rain showers', [82] = 'Violent showers', - [85] = 'Snow showers', [86] = 'Snow showers', - [95] = 'Thunderstorm', [96] = 'Thunderstorm, hail', [99] = 'Thunderstorm, hail', -} - --- WMO code in words. Reading a nil key from a table is not an error. -function M.describe(code) - return DESCRIBE[code] or 'Unknown' -end - -- Nearest integer, or nil when v is NaN, infinite or too big for an integer: -- %d and utf8.char raise on those, and a raise is a blank dashboard. local function round(v) return math.tointeger(math.floor(v + 0.5)) end |
