Skip to content

Commit

Permalink
fix: topo bad_maps
Browse files Browse the repository at this point in the history
  • Loading branch information
AvantLiu committed Dec 30, 2021
1 parent f164b86 commit 57d5bfe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/dgiot_topo/src/dgiot_topo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ get_Product() ->
case X of
#{<<"objectId">> := ProductId, <<"config">> := #{<<"konva">> := #{<<"Stage">> := #{<<"children">> := Children}}}, <<"thing">> := #{<<"properties">> := Properties}} ->
lists:map(fun(P) ->
DataType = maps:get(<<"dataType">>, P),
Type = maps:get(<<"type">>, DataType),
Specs = maps:get(<<"specs">>, DataType),
DataType = maps:get(<<"dataType">>, P, #{}),
Type = maps:get(<<"type">>, DataType, <<"">>),
Specs = maps:get(<<"specs">>, DataType, #{}),
Unit = maps:get(<<"unit">>, Specs, <<"">>),
Identifier = maps:get(<<"identifier">>, P),
Name = maps:get(<<"name">>, P),
Identifier = maps:get(<<"identifier">>, P, <<"">>),
Name = maps:get(<<"name">>, P, <<"">>),
dgiot_data:insert({product, <<ProductId/binary, Identifier/binary>>}, {Name, Type, Unit}),
dgiot_data:insert({thing, <<ProductId/binary, Identifier/binary>>}, P)
end, Properties),
Expand Down

0 comments on commit 57d5bfe

Please sign in to comment.