From 14bcc4721b00afc9153865f57117a458f68cdf5d Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 19 五月 2025 20:40:49 +0800
Subject: [PATCH] 2025年05月19日20:40:47
---
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 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 96a6427..216a922 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -68,6 +68,7 @@
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.photovoltaic.utils.NetworkUtils;
+import com.hdl.photovoltaic.utils.PermissionUtils;
import com.hdl.photovoltaic.utils.WifiUtils;
import com.hdl.sdk.link.common.exception.HDLLinkException;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
@@ -207,8 +208,22 @@
break;
//鍒涘缓鐢电珯
case HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION: {
+ //uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡
+// HdlResidenceLogic.getInstance().getResidenceIdList("","","","","","",1,50,null);
+ try {
+ String dataJsonStr = getKeyValue("data", data);
+ if (!TextUtils.isEmpty(dataJsonStr)) {
+ Gson gson = new Gson();
+ HouseIdBean houseIdBean = gson.fromJson(dataJsonStr, HouseIdBean.class);
+ HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true);
+ }
+ HdlLogLogic.print("uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡---"+dataJsonStr, true);
+ } catch (Exception e) {
+ HdlLogLogic.print("uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡---" + e.getMessage(), true);
+ }
+
//EventBus浜嬩欢鍒嗗彂
- HdlCommonLogic.getInstance().postEventBus(HDLUniMP.UNI_EVENT_REPLY_HOME_MODEL, HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION, getKeyValue("data", data));
+// HdlCommonLogic.getInstance().postEventBusSticky(HDLUniMP.UNI_EVENT_REPLY_HOME_MODEL, HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION, getKeyValue("data", data));
if (callback != null) {
uniSuccessCallback(type, null, callback);
}
@@ -388,6 +403,16 @@
WifiUtils wifiUtils = WifiUtils.getInstance();
//wifi妯″潡
switch (type) {
+ //鑾峰彇浣嶇疆鏉冮檺
+ case HDLUniMP.UNI_EVENT_REPLY_AUTHORIZATION_GET: {
+ boolean isLocalAuthor = PermissionUtils.checkPermission(HDLApp.getInstance(), Manifest.permission.ACCESS_FINE_LOCATION);
+ if (callback != null) {
+ JsonObject jsonObject = new JsonObject();
+ jsonObject.addProperty("localAuthor", isLocalAuthor);
+ uniSuccessCallback(mode_type, jsonObject, callback);
+ }
+ }
+ break;
//鑾峰彇鎵嬫満wifi鍒楄〃
case HDLUniMP.UNI_EVENT_REPLY_PHONE_WIFI_LIST: {
if (callback != null) {
@@ -646,6 +671,7 @@
} else if (HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL.equals(topic)) {
//鍏跺畠妯″潡
switch (type) {
+
//鑾峰彇娓╁害鍗曚綅
case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNIT: {
uniSuccessCallback(mode_type, UserConfigManage.getInstance().getTemperature_unit(), callback);
@@ -906,7 +932,7 @@
if (callback != null) {
uniSuccessCallback(type, null, callback);
}
- List<GatewayBean> list = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId, null);
+ List<GatewayBean> list = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId);
for (int i = 0; i < list.size(); i++) {
GatewayBean gatewayBean = list.get(i);
HdlDeviceLogic.getInstance().initializeInverter(gatewayBean.getDevice_mac(), null);
--
Gitblit v1.8.0