From: Roman Bazalevsky Date: Sun, 2 Dec 2018 22:21:27 +0000 (+0300) Subject: 1) Переход на доставку без гарантии (старые данные копить нет смысла) X-Git-Url: https://git.rvb.name/weathermon.git/commitdiff_plain/67f3d398664cc319615339c1ce9c525e672c332f 1) Переход на доставку без гарантии (старые данные копить нет смысла) 2) Исправлена фильтрация в случае выборки <= размеру окна --- diff --git a/bin/weather-filter b/bin/weather-filter index 1fc798f..84c2265 100755 --- a/bin/weather-filter +++ b/bin/weather-filter @@ -42,6 +42,10 @@ function filter_data(dataset,width) width = 7 end + if #dataset <= width then + return dataset + end + local result = {} local window_spread = math.floor(width/2) diff --git a/bin/weathermon b/bin/weathermon index 804ba25..cc58def 100755 --- a/bin/weathermon +++ b/bin/weathermon @@ -189,7 +189,7 @@ function processJson(str) if not mqtt_client:socket() then mqtt_client:reconnect() end - mqtt_client:publish(mqtt_path,v) + mqtt_client:publish(mqtt_path,v,0,0) mqtt_client:loop() end end @@ -252,7 +252,7 @@ function processLine(str) return '{'..name..'}' end end) - mqtt_client:publish(mqtt_path,v) + mqtt_client:publish(mqtt_path,v,0,0) mqtt_client:loop() end end @@ -293,7 +293,7 @@ function processLine(str) return '{'..name..'}' end end) - mqtt_client:publish(mqtt_path,msg_body) + mqtt_client:publish(mqtt_path,msg_body,0,0) mqtt_client:loop() end if alarm_exec then