| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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通信用到) |
| | | */ |