From d830fef6a2bc2ab061e6ac2b423c4a49dda3cf21 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 06 十二月 2023 18:08:26 +0800
Subject: [PATCH] 2023年12月06日18:08:20
---
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
index 58ef4c6..9158911 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -412,12 +412,16 @@
String hardwareModel = getKeyValue("hardwareModel", getKeyValue("data", data));//纭欢鍨嬪彿
String osImageId = getKeyValue("osImageId", getKeyValue("data", data));//绯荤粺闀滃儚id
String firmwareVersionId = getKeyValue("firmwareVersionId", getKeyValue("data", data));//鍥轰欢鐗堟湰id
+// String oid = getKeyValue("oid", getKeyValue("data", data));//鍥轰欢oid
List<DeviceFirmwareBean> list = new ArrayList<>();
String driverFileList = HdlFileLogic.getInstance().getFirmwareRootPath();
File file = new File(driverFileList);
if (file.list() != null) {
for (int i = 0; i < Objects.requireNonNull(file.list()).length; i++) {
String path = Objects.requireNonNull(file.list())[i];
+// if (!path.contains(oid)) {
+// continue;
+// }
String[] ary = path.split("/");
String[] driverInfoAry = ary[ary.length - 1].split("_");
DeviceFirmwareBean deviceFirmwareBean = new DeviceFirmwareBean();
@@ -439,7 +443,7 @@
*/
private void uniDeviceFirmwareDownload(Object data, DCUniMPJSCallback callback) {
String deviceOidId = getKeyValue("deviceOidId", getKeyValue("data", data));//浜戠涓婅澶噄d
- String oid = getKeyValue("oid", getKeyValue("data", data));//鍥轰欢鐨刼id
+ String oid = getKeyValue("oid", getKeyValue("data", data));//璇ュ浐浠剁殑oid
String imageId = getKeyValue("imageId", getKeyValue("data", data));//鍥轰欢闀滃儚id
String version = getKeyValue("version", getKeyValue("data", data));//鍥轰欢鐗堟湰
String localUrl = getKeyValue("localUrl", getKeyValue("data", data));//鍌ㄥ瓨鍦ㄦ湰鍦板浐浠舵枃浠惰矾寰�
@@ -996,11 +1000,18 @@
public void onSuccess(List<GatewayBean> list) {
if (callback != null) {
uniCallbackData(list, callback);
- //EventBus浜嬩欢鍒嗗彂
+ //EventBus浜嬩欢鍒嗗彂,杩涘叆浣忓畢寮�濮嬭闃呬富棰�
BaseEventBus baseEventBus = new BaseEventBus();
baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST);
baseEventBus.setData(list);
EventBus.getDefault().post(baseEventBus);
+ GatewayBean gatewayBean = HdlDeviceLogic.getInstance().queryCurrentHomeMainGateway(list);
+ if (gatewayBean != null) {
+ //杩涙潵浣忓畢璇︽儏閮借涓婁紶涓�娆id鍒楄〃鍒颁簯绔�;
+ HdlDeviceLogic.getInstance().uploadDataToCloud(gatewayBean.getDevice_mac(), null);
+ }
+
+
}
}
--
Gitblit v1.8.0