| | |
| | | break; |
| | | //获取逆变器列表 |
| | | case HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST: { |
| | | this.uniGetCurrentHomeLocalAndCloudGatewayList(callback); |
| | | this.uniGetCurrentHomeLocalAndCloudGatewayList(data, callback); |
| | | } |
| | | break; |
| | | //modBus协议专用 |
| | |
| | | try { |
| | | HDLUniMPSDKManager.getInstance().sendUniMPEvent(HDLUniMP.UNI_APP_ID, topic, getJSONObject(callBackBaseBean)); |
| | | } catch (Exception e) { |
| | | HdlLogLogic.print("uni===原生主动向小程序发送通知事件===" + e.getMessage(), false); |
| | | HdlLogLogic.print("uni--->原生主动向小程序发送通知事件--->" + e.getMessage(), false); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | private void uniUploadDataToCloud(Object data, DCUniMPJSCallback callback) { |
| | | String mac = getKeyValue("mac", getKeyValue("data", data)); |
| | | HdlDeviceLogic.getInstance().uploadDataToCloud(mac, null); |
| | | HdlDeviceLogic.getInstance().uploadDataToCloud(UserConfigManage.getInstance().getHomeId(), mac, null); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param callback uni回调 |
| | | */ |
| | | private void uniGetCurrentHomeLocalAndCloudGatewayList(DCUniMPJSCallback callback) { |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(UserConfigManage.getInstance().getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | private void uniGetCurrentHomeLocalAndCloudGatewayList(Object data, DCUniMPJSCallback callback) { |
| | | String homeId = getKeyValue("homeId", getKeyValue("data", data)); |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(homeId, new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | GatewayBean gatewayBean = HdlDeviceLogic.getInstance().queryCurrentHomeMainGateway(list); |
| | | if (gatewayBean != null) { |
| | | //进来住宅详情都要上传一次oid列表到云端; |
| | | HdlDeviceLogic.getInstance().uploadDataToCloud(gatewayBean.getDevice_mac(), null); |
| | | HdlDeviceLogic.getInstance().uploadDataToCloud(homeId, gatewayBean.getDevice_mac(), null); |
| | | } |
| | | //EventBus事件分发,进入住宅开始订阅主题 |
| | | BaseEventBus baseEventBus = new BaseEventBus(); |