fix device
This commit is contained in:
parent
0fb00a87a9
commit
19803549ad
@ -179,6 +179,9 @@ code_change(_OldVsn, StateName, State = #state{}, _Extra) ->
|
|||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
|
|
||||||
-spec report_event(DeviceUUID :: binary(), NewStatus :: integer()) -> no_return().
|
-spec report_event(DeviceUUID :: binary(), NewStatus :: integer()) -> no_return().
|
||||||
|
report_event(DeviceUUID, ?DEVICE_UNKNOWN) ->
|
||||||
|
lager:notice("[iot_device] device_uuid: ~p, status: unknown, not report", [DeviceUUID]),
|
||||||
|
ok;
|
||||||
report_event(DeviceUUID, NewStatus) when is_binary(DeviceUUID), is_integer(NewStatus) ->
|
report_event(DeviceUUID, NewStatus) when is_binary(DeviceUUID), is_integer(NewStatus) ->
|
||||||
%% 设备的状态信息上报给中电
|
%% 设备的状态信息上报给中电
|
||||||
Timestamp = iot_util:timestamp_of_seconds(),
|
Timestamp = iot_util:timestamp_of_seconds(),
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"key": "device_status",
|
"key": "device_status",
|
||||||
"value": NewStatus, 0: 离线, 1: 在线, 2: 未知
|
"value": NewStatus, 0: 离线, 1: 在线
|
||||||
"unit": 0,
|
"unit": 0,
|
||||||
"type": <<"DI">>,
|
"type": <<"DI">>,
|
||||||
"name": "设备状态",
|
"name": "设备状态",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user