From 22494af577e21a930abef309f2f60c03c9615bd1 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期五, 07 七月 2023 18:16:55 +0800
Subject: [PATCH] 2023年07月07日18:16:52

---
 app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java |   34 +++++++++++++---------------------
 1 files changed, 13 insertions(+), 21 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
index 73039a7..674b46e 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
@@ -17,6 +17,7 @@
 import com.hdl.sdk.link.core.bean.gateway.GatewayBean;
 import com.hdl.sdk.link.core.callback.GatewayCallBack;
 import com.hdl.sdk.link.core.config.HDLLinkConfig;
+import com.hdl.sdk.link.gateway.HDLLinkLocalGateway;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -258,13 +259,19 @@
         HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
             @Override
             public void onSuccess(HttpResponsePack httpResponsePack) {
-                if (httpResponsePack != null && httpResponsePack.getData() != null) {
-                    Gson gson = new Gson();
-                    String jsonStr = gson.toJson(httpResponsePack.getData());
-                    HouseInfoBean houseInfoBean = gson.fromJson(jsonStr, HouseInfoBean.class);
+                try {
+                    if (httpResponsePack != null && httpResponsePack.getData() != null) {
+                        Gson gson = new Gson();
+                        String jsonStr = gson.toJson(httpResponsePack.getData());
+                        HouseInfoBean houseInfoBean = gson.fromJson(jsonStr, HouseInfoBean.class);
 
+                        if (cloudCallBeak != null) {
+                            cloudCallBeak.onSuccess(houseInfoBean);
+                        }
+                    }
+                } catch (Exception exception) {
                     if (cloudCallBeak != null) {
-                        cloudCallBeak.onSuccess(houseInfoBean);
+                        cloudCallBeak.onFailure(exception);
                     }
                 }
             }
@@ -524,33 +531,18 @@
         HdlFileLogic.getInstance().createDirectory();
         //閰嶇疆鏈湴閫氫俊鐨勪俊鎭�
         initLocalLinkSdk();
-
-//        HdlDeviceLogic.getInstance().getInverterDeviceList(UserConfigManage.getInstance().getHomeId(), new CloudCallBeak<CloudInverterDeviceBean>() {
-//            @Override
-//            public void onSuccess(CloudInverterDeviceBean obj) {
-//
-//
-//            }
-//
-//            @Override
-//            public void onFailure(Exception exception) {
-//
-//            }
-//        });
         HdlDeviceLogic.getInstance().searchGateway(new GatewayCallBack() {
             @Override
             public void onSuccess(List<GatewayBean> gatewayBeanList) {
-
             }
 
             @Override
             public void onError(HDLLinkException e) {
-
             }
         });
-
     }
 
+
     /**
      * 閰嶇疆鏈湴閫氫俊鐨勪俊鎭�(tcp閫氫俊鐢ㄥ埌)
      */

--
Gitblit v1.8.0