Обработка неопределенных значений в веб-интерфейсе.
[weathermon.git] / bin / weathermon
index 8da469650890303c2483c028df13c797f1104b7c..fdf092a3406aa0c62a02fdc4954af2a618288e04 100755 (executable)
@@ -185,7 +185,7 @@ function processJson(str)
         if not mqtt_client:socket() then
           mqtt_client:reconnect()
         end  
-        mqtt_client:publish(mqtt_path,v,0,0)
+        mqtt_client:publish(mqtt_path,v,0,false)
         mqtt_client:loop()
       end  
     end
@@ -248,7 +248,10 @@ function processLine(str)
                 return '{'..name..'}'
               end      
             end)
-          mqtt_client:publish(mqtt_path,v,0,0)
+          if not mqtt_client:socket() then
+            mqtt_client:reconnect()
+          end  
+          mqtt_client:publish(mqtt_path,v,0,false)
           mqtt_client:loop()
         end  
       end
@@ -289,7 +292,10 @@ function processLine(str)
               return '{'..name..'}'
             end      
           end)
-        mqtt_client:publish(mqtt_path,msg_body,0,0)
+        if not mqtt_client:socket() then
+          mqtt_client:reconnect()
+        end  
+        mqtt_client:publish(mqtt_path,msg_body,0,false)
         mqtt_client:loop()
       end
       if alarm_exec then