| | |
| | | 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; |
| | |
| | | import java.lang.reflect.Type; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.rxjava3.disposables.Disposable; |
| | | |
| | | /** |
| | | * 设备逻辑的界面 |
| | |
| | | /** |
| | | * 获取逆变器列表 |
| | | * |
| | | * @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() { |
| | |
| | | } |
| | | |
| | | |
| | | 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; |
| | | } |
| | | } |