Unverified Commit d511f5b1 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

handle influx_str == nil

parent d534be76
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -126,8 +126,10 @@ function push_data()
	end
	if have_photoresistor then
		json_str = json_str .. string.format('"brightness_percent": %d.%01d, ', brightness/10, brightness%10)
		if influx_str then
			influx_str = influx_str .. string.format(",brightness_percent=%d.%01d", brightness/10, brightness%10)
		end
	end
	json_str = json_str .. '"rssi_dbm": ' .. wifi.sta.getrssi() .. '}'
	print("Publishing " .. json_str)
	mqttclient:publish("sensor/" .. device_id .. "/data", json_str, 0, 0, function(client)