[api] process phase information sent from the Fluksometer
This commit is contained in:
parent
997dbc4071
commit
6345a9c97c
|
@ -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_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_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_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(timezone, <<"SELECT timezone FROM users WHERE uid = ?">>),
|
||||||
mysql:prepare(device_key, <<"SELECT sha FROM logger_devices WHERE device = ?">>),
|
mysql:prepare(device_key, <<"SELECT sha FROM logger_devices WHERE device = ?">>),
|
||||||
mysql:prepare(device_props, <<"SELECT sha, upgrade, resets FROM logger_devices WHERE device = ?">>),
|
mysql:prepare(device_props, <<"SELECT sha, upgrade, resets FROM logger_devices WHERE device = ?">>),
|
||||||
|
|
|
@ -168,6 +168,7 @@ process_config({struct, Params}, ReqData, #state{rrdSensor = Sensor} = State) ->
|
||||||
proplists:get_value(<<"function">>, Params),
|
proplists:get_value(<<"function">>, Params),
|
||||||
proplists:get_value(<<"voltage">>, Params),
|
proplists:get_value(<<"voltage">>, Params),
|
||||||
proplists:get_value(<<"current">>, Params),
|
proplists:get_value(<<"current">>, Params),
|
||||||
|
proplists:get_value(<<"phase">>, Params),
|
||||||
proplists:get_value(<<"constant">>, Params),
|
proplists:get_value(<<"constant">>, Params),
|
||||||
proplists:get_value(<<"enable">>, Params),
|
proplists:get_value(<<"enable">>, Params),
|
||||||
Sensor],
|
Sensor],
|
||||||
|
|
Loading…
Reference in New Issue