wjc
2023-06-30 073e5d5103870246fe33029e5f6d36536a1bb76c
app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
@@ -20,6 +20,7 @@
import com.hdl.photovoltaic.ui.bean.OidBean;
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.sdk.link.common.exception.HDLLinkCode;
import com.hdl.sdk.link.common.exception.HDLLinkException;
import com.hdl.sdk.link.core.bean.gateway.GatewayBean;
import com.hdl.sdk.link.core.callback.GatewayCallBack;
@@ -58,18 +59,23 @@
    /**
     * 添加逆变器
     *
     * @param inverterDeviceBean 逆变器对象
     * @param cloudCallBeak      回调
     * @param mac           -
     * @param spk           -
     * @param sid           -
     * @param oid           -
     * @param name          -
     * @param cloudCallBeak
     */
    public void addInverterDevice(InverterDeviceBean inverterDeviceBean, CloudCallBeak<Boolean> cloudCallBeak) {
    public void addInverterDevice(String mac, String spk, String sid, String oid, String name, CloudCallBeak<Boolean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_Device_Add;
        JsonObject json = new JsonObject();
        json.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
        json.addProperty("mac", inverterDeviceBean.getDevice_mac());
        json.addProperty("spk", inverterDeviceBean.getGateway_type());
        json.addProperty("sid", inverterDeviceBean.getSid());
        json.addProperty("oid", inverterDeviceBean.getOid());
        json.addProperty("name", inverterDeviceBean.getDevice_name());
        json.addProperty("mac", mac);
        json.addProperty("spk", spk);
        json.addProperty("sid", sid);
        json.addProperty("oid", oid);
        json.addProperty("name", name);
        // json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
@@ -271,7 +277,7 @@
     * @param mac           设备mac
     * @param cloudCallBeak 回调update
     */
    public void steEditGatewayParam(String mac, CloudCallBeak<Boolean> cloudCallBeak) {
    public void editGatewayParam(String mac, CloudCallBeak<Boolean> cloudCallBeak) {
        String requestUrl = TopicApi.GATEWAY_SEND_EDIT;
        JsonObject json = new JsonObject();
        json.addProperty("master", "true");