| | |
| | | removeInverter(removeSidList.get(i)); |
| | | } |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | CloudInverterDeviceBean cloudInverterDeviceBean = list.get(i); |
| | | GatewayBean gatewayBean = HDLLinkLocalGateway.getInstance().getLocalGateway(cloudInverterDeviceBean.getSid()); |
| | | objectAssignment(cloudInverterDeviceBean, gatewayBean); |
| | | } |
| | | |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(true); |
| | | } |
| | |
| | | CloudInverterDeviceBean cloudInverterDeviceBean = list.get(i); |
| | | //云端对象数据交换到本地对象 |
| | | GatewayBean gatewayBean = new GatewayBean(); |
| | | gatewayBean.setOid(cloudInverterDeviceBean.getOid()); |
| | | gatewayBean.setSid(cloudInverterDeviceBean.getSid()); |
| | | gatewayBean.setGatewayId(cloudInverterDeviceBean.getGatewayId()); |
| | | gatewayBean.setOnline(cloudInverterDeviceBean.isOnline()); |
| | | gatewayBean.setDevice_mac(cloudInverterDeviceBean.getOsn());//设备mac |
| | | gatewayBean.setDevice_name(cloudInverterDeviceBean.getGatewayName()); |
| | | 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()); |
| | | objectAssignment(cloudInverterDeviceBean, gatewayBean); |
| | | |
| | | //添加网关 |
| | | HDLLinkLocalGateway.getInstance().getGatewayList().add(gatewayBean); |
| | |
| | | HDLLinkLocalGateway.getInstance().refreshGatewayByHomeIdAndSpk(UserConfigManage.getInstance().getHomeId(), spks, true, gatewayCallBack); |
| | | } |
| | | |
| | | |
| | | private void objectAssignment(CloudInverterDeviceBean cloudInverterDeviceBean, GatewayBean gatewayBean) { |
| | | if (cloudInverterDeviceBean == null || gatewayBean == null) { |
| | | return; |
| | | } |
| | | gatewayBean.setOid(cloudInverterDeviceBean.getOid()); |
| | | gatewayBean.setSid(cloudInverterDeviceBean.getSid()); |
| | | gatewayBean.setGatewayId(cloudInverterDeviceBean.getGatewayId()); |
| | | gatewayBean.setOnline(cloudInverterDeviceBean.isOnline()); |
| | | gatewayBean.setDevice_mac(cloudInverterDeviceBean.getOsn());//设备mac |
| | | gatewayBean.setDevice_name(cloudInverterDeviceBean.getGatewayName()); |
| | | 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()); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取网关spk列表 |
| | | * |