[api] process phase information sent from the Fluksometer

This commit is contained in:
Bart Van Der Meerssche 2011-04-26 08:26:24 +00:00
parent 997dbc4071
commit 6345a9c97c
2 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,7 @@ mysql_prepare() ->
mysql:prepare(sensor_key, <<"SELECT sha FROM (logger_devices ld INNER JOIN logger_meters lm ON ld.device = lm.device) WHERE lm.meter = ?">>),
mysql:prepare(sensor_props, <<"SELECT uid, device, night FROM logger_meters WHERE meter = ?">>),
mysql:prepare(sensor_update, <<"UPDATE logger_meters SET access = ?, night = ?, value = ? WHERE meter = ?">>),
mysql:prepare(sensor_config, <<"UPDATE logger_meters SET class = ?, type = ?, function = ?, voltage = ?, current = ?, constant = ?, enabled = ? WHERE meter = ?">>),
mysql:prepare(sensor_config, <<"UPDATE logger_meters SET class = ?, type = ?, function = ?, voltage = ?, current = ?, phase = ?, constant = ?, enabled = ? WHERE meter = ?">>),
mysql:prepare(timezone, <<"SELECT timezone FROM users WHERE uid = ?">>),
mysql:prepare(device_key, <<"SELECT sha FROM logger_devices WHERE device = ?">>),
mysql:prepare(device_props, <<"SELECT sha, upgrade, resets FROM logger_devices WHERE device = ?">>),

View File

@ -168,6 +168,7 @@ process_config({struct, Params}, ReqData, #state{rrdSensor = Sensor} = State) ->
proplists:get_value(<<"function">>, Params),
proplists:get_value(<<"voltage">>, Params),
proplists:get_value(<<"current">>, Params),
proplists:get_value(<<"phase">>, Params),
proplists:get_value(<<"constant">>, Params),
proplists:get_value(<<"enable">>, Params),
Sensor],