wjc
2023-06-29 6002cb9371055af6d37c8581d207cf6e3d0f9a4a
app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
@@ -4,6 +4,7 @@
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.hdl.hdlhttp.HxHttp;
import com.hdl.photovoltaic.bean.HttpResponsePack;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.internet.HttpClient;
@@ -24,6 +25,8 @@
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.rxjava3.disposables.Disposable;
/**
 * 设备逻辑的界面
@@ -85,13 +88,13 @@
    /**
     * 获取逆变器列表
     *
     * @param inverterDeviceBean 逆变器对象
     * @param cloudCallBeak      回调
     * @param homeId        住宅id
     * @param cloudCallBeak 回调
     */
    public void getInverterDeviceList(InverterDeviceBean inverterDeviceBean, CloudCallBeak<CloudInverterDeviceBean> cloudCallBeak) {
    public void getInverterDeviceList(String homeId, CloudCallBeak<CloudInverterDeviceBean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_Device_List;
        JsonObject json = new JsonObject();
        json.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
        json.addProperty("homeId", homeId);
        // json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
@@ -233,11 +236,25 @@
    }
    public void searchGateway(GatewayCallBack gatewayCallBack)
    {
        List<String> spks = new ArrayList<>();
        spks.add("energy.hdl_inverter");
    /**
     * 搜索网关列表
     *
     * @param gatewayCallBack -
     */
    public void searchGateway(GatewayCallBack gatewayCallBack) {
        List<String> spks = this.getGatewaySpk();
        //网关搜索
        HDLLinkLocalGateway.getInstance().refreshGatewayByHomeIdAndSpk(UserConfigManage.getInstance().getHomeId(), spks, true, gatewayCallBack);
    }
    /**
     * 获取网关spk列表
     *
     * @return -
     */
    private List<String> getGatewaySpk() {
        List<String> spks = new ArrayList<>();
        spks.add("energy.hdl_inverter");
        return spks;
    }
}