| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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 |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |