| | |
| | | }); |
| | | } else { |
| | | showLoading(getString(R.string.deleting_please_wait)); |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, list); |
| | | if (houseIdBean.getDebugType().equals(DebugType.NORMAL)) { |
| | | //【常规方式】发起删除电站指令 |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, list); |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | }); |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | }); |
| | | } else { |
| | | //【简易方式】发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | |
| | | deviceInfoAdapter.setOnclickListener(new DeviceInfoAdapter.OnClickListener() { |
| | | @Override |
| | | public void onClick(int position, CloudInverterDeviceBean deviceBean) { |
| | | deviceBean.setActivate(true);//默认激活 |
| | | // //杨涛说这个列表不返回未激活的设备,所以去掉判断 |
| | | // if (!deviceBean.isActivate()) { |
| | | // HdlThreadLogic.toast(_mActivity, getString(R.string.device_not_activated)); |
| | |
| | | if (isRefreshing) { |
| | | showLoading(getString(R.string.device_loading)); |
| | | } |
| | | //获取住宅(电站)ID列表 |
| | | //获取设备列表 |
| | | HdlDeviceLogic.getInstance().getPowerStationDeviceList("", pageNo, pageSize, new CloudCallBeak<PageNumberObject<CloudInverterDeviceBean>>() { |
| | | @Override |
| | | public void onSuccess(PageNumberObject<CloudInverterDeviceBean> pageNumberObject) { |
| | |
| | | HdlResidenceLogic.getInstance().delHouseId(houseIdBean.getHomeId());//删除电站缓存 |
| | | initData();//初始化缓存数据 |
| | | if (houseInfoAdapter != null) { |
| | | // houseInfoAdapter.setList(houseListBeanIDList, powerStationStatusValue);//重新刷新列表 |
| | | houseInfoAdapter.notifyItemRemoved(position);//只刷新当前的位置 |
| | | houseInfoAdapter.setList(houseListBeanIDList, powerStationStatusValue);//重新刷新列表 |
| | | // houseInfoAdapter.notifyItemRemoved(position);//只刷新当前的位置 |
| | | } |
| | | getStatusOverview();//删除成功后刷新电站状态概览 |
| | | nullDataUpdateUi();//检测数据是否为空 |