fix mock
This commit is contained in:
parent
a1343cb992
commit
5aa588f990
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
%% API
|
%% API
|
||||||
-export([start_link/0]).
|
-export([start_link/0]).
|
||||||
-export([mock/4]).
|
-export([mock/5]).
|
||||||
|
|
||||||
%% gen_server callbacks
|
%% gen_server callbacks
|
||||||
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
|
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
|
||||||
@ -43,12 +43,13 @@
|
|||||||
%%% API
|
%%% API
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
|
|
||||||
mock(LocationCode, SType, CType, Value) when is_binary(LocationCode), is_integer(SType), is_integer(CType) ->
|
mock(LocationCode, Para, SType, CType, Value) when is_binary(LocationCode), is_integer(SType), is_integer(CType), is_integer(Para) ->
|
||||||
Req = #{
|
Req = #{
|
||||||
<<"version">> => <<"1.0">>,
|
<<"version">> => <<"1.0">>,
|
||||||
<<"ts">> => iot_util:current_time(),
|
<<"ts">> => iot_util:current_time(),
|
||||||
<<"properties">> => #{
|
<<"properties">> => #{
|
||||||
<<"type">> => <<"ctrl">>,
|
<<"type">> => <<"ctrl">>,
|
||||||
|
<<"para">> => Para,
|
||||||
<<"stype">> => SType,
|
<<"stype">> => SType,
|
||||||
<<"ctype">> => CType,
|
<<"ctype">> => CType,
|
||||||
<<"value">> => Value,
|
<<"value">> => Value,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user