29.08.2022, 06:42
Try this (data is decoded JSON response):
Code:
values = data.indicator.values
table.sort(values, function(a, b)
return a.value < b.value
end)
min = values[1]
minvalue = min.value
minhour = min.datetime:match('T(%d+)')
log(minvalue, minhour)
max = values[#values]
maxvalue = max.value
maxhour = max.datetime:match('T(%d+)')
log(maxvalue, maxhour)