From b8209d15d915f72d9abe3a68b76e1f4cfd21eac3 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期六, 23 九月 2023 14:37:00 +0800 Subject: [PATCH] 2023年09月23日14:36:51 --- app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java index a0ca15f..49d7dce 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java @@ -38,7 +38,7 @@ import io.reactivex.rxjava3.disposables.Disposable; /** - * 璁惧閫昏緫鐨勭晫闈� + * 璁惧閫昏緫 */ public class HdlDeviceLogic { private static volatile HdlDeviceLogic sHdlDeviceLogic; @@ -407,7 +407,7 @@ @Override public void onSuccess(List<CloudInverterDeviceBean> list) { if (list == null || list.size() == 0) { -// //浜戠娌℃湁缁戝畾閫嗗彉鍣�,娓呯┖鏈湴鍒楄〃; +// //浜戠娌℃湁缁戝畾閫嗗彉鍣�,浠ユ湰鍦颁负涓�; // HDLLinkLocalGateway.getInstance().getGatewayList().clear(); if (cloudCallBeak != null) { cloudCallBeak.onSuccess(true); @@ -451,18 +451,13 @@ HdlDeviceLogic.getInstance().getCloudInverterDeviceList(UserConfigManage.getInstance().getHomeId(), new CloudCallBeak<List<CloudInverterDeviceBean>>() { @Override public void onSuccess(List<CloudInverterDeviceBean> list) { - if (list == null) { + if (list == null || list.size() == 0) { if (cloudCallBeak != null) { cloudCallBeak.onSuccess(true); } return; } - if (list.size() <= 0) { - if (cloudCallBeak != null) { - cloudCallBeak.onSuccess(true); - } - return; - } + //娓呮鏈湴缃戝叧鍒楄〃 HDLLinkLocalGateway.getInstance().getGatewayList().clear(); for (int i = 0; i < list.size(); i++) { CloudInverterDeviceBean cloudInverterDeviceBean = list.get(i); @@ -475,6 +470,7 @@ gatewayBean.setHomeId(UserConfigManage.getInstance().getHomeId()); gatewayBean.setLocalEncrypt(true); gatewayBean.setMaster("true"); + //娣诲姞缃戝叧 HDLLinkLocalGateway.getInstance().getGatewayList().add(gatewayBean); } if (cloudCallBeak != null) { -- Gitblit v1.8.0