From e6c7771ce1c0e3a9c46b2727fd5e3bfbce46a1bf Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Thu, 9 Jan 2025 14:55:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E6=85=A7=E7=85=A7=E6=98=8E=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=9A=84=E6=95=B0=E6=8D=AE=E6=8C=89=E7=85=A7=E5=BB=BA?= =?UTF-8?q?=E7=AD=91=E7=89=A9=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/iot/src/iot_build.erl | 3 +-- apps/iot/src/iot_device.erl | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/iot/src/iot_build.erl b/apps/iot/src/iot_build.erl index dc75635..e354a0d 100644 --- a/apps/iot/src/iot_build.erl +++ b/apps/iot/src/iot_build.erl @@ -111,8 +111,7 @@ handle_info({timeout, _, report_ticker}, State = #state{accumulators = Accumulat Props0 = lists:map(fun(Key) -> merge(Key, L) end, [<<"total_power">>, <<"total_runtime">>, <<"use_times">>]), Fields = lists:flatten(Props0), - lager:debug("[iot_build] merged fileds is: ~p", [Fields]), - %iot_zd_endpoint:forward(LocationCode, LocationCode, Fields, Timestamp), + iot_zd_endpoint:forward(LocationCode, LocationCode, Fields, Timestamp), iot_build_logger:write([LocationCode, jiffy:encode(Fields, [force_utf8])]), erlang:start_timer(?REPORT_INTERVAL, self(), report_ticker), diff --git a/apps/iot/src/iot_device.erl b/apps/iot/src/iot_device.erl index 3e79b7d..acf8db4 100644 --- a/apps/iot/src/iot_device.erl +++ b/apps/iot/src/iot_device.erl @@ -293,14 +293,11 @@ handle_cast({handle_data, Fields, Timestamp}, State = #state{device_uuid = Devic case ModelId =:= 20 of true -> NLocationCode = extract_build_location_code(LocationCode), - lager:debug("[iot_device] light device: ~p, build location_code: ~p", [DeviceUUID, NLocationCode]), {ok, BuildPid} = iot_build_sup:ensured_build_started(NLocationCode), iot_build:handle_data(BuildPid, DeviceUUID, Fields, Timestamp); false -> - ok - %iot_zd_endpoint:forward(LocationCode, DynamicLocationCode, Fields, Timestamp) - end, - iot_zd_endpoint:forward(LocationCode, DynamicLocationCode, Fields, Timestamp); + iot_zd_endpoint:forward(LocationCode, DynamicLocationCode, Fields, Timestamp) + end; {ok, _} -> lager:warning("[iot_device] the north_data hget location_code, uuid: ~p, not found, fields: ~p", [DeviceUUID, Fields]); {error, Reason} ->