| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.rxjava3.disposables.Disposable; |
| | | |
| | | /** |
| | | * 设备逻辑 |
| | |
| | | public void onSuccess(String str) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(true); |
| | | //临时的逻辑,上传oid列表到云端 |
| | | getGatewayOidList(mac, new LinkCallBack<List<OidBean>>() { |
| | | @Override |
| | | public void onSuccess(List<OidBean> obj) { |
| | | if (obj == null) { |
| | | return; |
| | | } |
| | | fullUpdateOid(obj, new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | |
| | | * @param cloudCallBeak 回调update |
| | | */ |
| | | public void fullUpdateOid(List<OidBean> oidList, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | String requestUrl = HttpApi.POST_Device_ChildDevices_List; |
| | | String requestUrl = HttpApi.POST_Device_Oid; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("operationSource", "PROGRAM_ENERGY");// |
| | | json.addProperty("homeId", UserConfigManage.getInstance().getHomeId()); |
| | |
| | | gatewayBean.setHomeId(UserConfigManage.getInstance().getHomeId()); |
| | | gatewayBean.setLocalEncrypt(true); |
| | | gatewayBean.setMaster("true"); |
| | | gatewayBean.setSystemStatusDesc(cloudInverterDeviceBean.getSystemStatusDesc()); |
| | | gatewayBean.setHwVersion(cloudInverterDeviceBean.getHwVersion()); |
| | | gatewayBean.setCategorySecondName(cloudInverterDeviceBean.getCategorySecondName()); |
| | | gatewayBean.setDeviceId(cloudInverterDeviceBean.getDeviceId()); |
| | | |
| | | //添加网关 |
| | | HDLLinkLocalGateway.getInstance().getGatewayList().add(gatewayBean); |
| | | } |