From 70c1ba24af27ba64e1d9ad50eb722541212ed8b6 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期五, 30 六月 2023 17:26:54 +0800 Subject: [PATCH] 2023年06月30日17:26:51 --- app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 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 6f7334a..4e7f0d6 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); } } } @@ -511,9 +518,9 @@ */ public void switchHouse(HouseIdBean houseIdBean) { String oidHomeId = UserConfigManage.getInstance().getHomeId(); - if (houseIdBean.getHomeId().equals(oidHomeId)) { - return; - } +// if (houseIdBean.getHomeId().equals(oidHomeId)) { +// return; +// } //鍒犻櫎鏃х殑浣忓畢鏂囦欢澶� HdlFileLogic.getInstance().deleteDirectory(HdlFileLogic.getInstance().getCurrentHomeRootPath()); //閲嶆柊璁剧疆浣忓畢id @@ -549,6 +556,8 @@ } }); + + } /** -- Gitblit v1.8.0