X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=sensor_graph%2Fsample_sensor.lua;fp=sensor_graph%2Fsample_sensor.lua;h=0000000000000000000000000000000000000000;hb=249ad38e27bf865a50112a5b4b58e8c590923034;hp=31cdfc3b2cbb49dfe2bbc57381cf0fff780d7e46;hpb=8b8bab09ff860da5804edf220740564c28ba9827;p=svn42.git diff --git a/sensor_graph/sample_sensor.lua b/sensor_graph/sample_sensor.lua deleted file mode 100755 index 31cdfc3..0000000 --- a/sensor_graph/sample_sensor.lua +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/lua -require('os') -require('string') -require('io') - -function parse_value(str) - last_temp = 0.0 - last_light = 0 - if string.find(str,"temp0: Temp C:") then - last_temp = tonumber(string.sub(str,15)) - os.execute(string.format("rrdtool update /home/sensortemp.rrd -t temp N:%f", last_temp)) - --print(string.format("t: %f Grad Celsius",last_temp)) - end - if string.find(str,"photo0: Photo:") then - last_light = tonumber(string.sub(str,15)) - os.execute(string.format("rrdtool update /home/sensorlight.rrd -t light N:%d", last_light)) - --print(string.format("p: %d",last_light)) - end -end - -while 1 do - local line = io.read("*line") - if line then - parse_value(line) - else - break - end -end