From 68d9078b49cfa8e83ed553835b05d4042c183969 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 16 三月 2023 09:39:34 +0800
Subject: [PATCH] 云台不显示问题修复,LC问题

---
 AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/LCDeviceEngine.java |   45 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/LCDeviceEngine.java b/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/LCDeviceEngine.java
index eba13db..70ff7bd 100644
--- a/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/LCDeviceEngine.java
+++ b/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/LCDeviceEngine.java
@@ -1,6 +1,7 @@
 package com.mm.android.deviceaddmodule;
 
 import android.app.Activity;
+import android.app.Application;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
@@ -39,6 +40,16 @@
     private Throwable throwable;
     public CommonParam commonParam;
     public String userId = "";
+    private String homeId;
+
+    private Application context;
+    public Application getContext() {
+        return context;
+    }
+
+    public void setContext(Application context) {
+        this.context = context;
+    }
 
     public static LCDeviceEngine newInstance() {
         if (lcDeviceEngine == null) {
@@ -53,9 +64,10 @@
 
     public boolean init(CommonParam commonParam) throws Throwable {
         this.commonParam = commonParam;
-        this.accessToken = "";
+        this.accessToken = "St_0000c3e2e772d5f74bfca2d86eaa18a6";//涓轰簡浣庡眰绌哄垽鏂紝褰撳墠token鏃犳晥
         this.userId = "";
         this.sdkHasInit = false;
+        this.context = commonParam.getContext();
         if (commonParam == null) {
             throw new Exception("commonParam must not null");
         }
@@ -63,13 +75,15 @@
         commonParam.checkParam();
         //鍒濆鍖栧弬鏁�
         initParam(commonParam);
-        //鑾峰彇寮�鏀惧钩鍙皌oken
-        initToken();
-        if (TextUtils.isEmpty(accessToken)) {
-            throw throwable;
+        if (!CONST.HOST.contains("hdlcontrol.com")) {
+            //鑾峰彇寮�鏀惧钩鍙皌oken
+            initToken();
+            if (TextUtils.isEmpty(accessToken)) {
+                throw throwable;
+            }
         }
         //缁勪欢鍒濆鍖�
-        InitParams initParams = new InitParams(commonParam.getContext(), CONST.HOST.replace("https://", ""), accessToken);
+        InitParams initParams = new InitParams(commonParam.getContext(), CONST.Envirment.OVERSEAS_PRO.url.replace("https://", ""), accessToken);
         LCOpenSDK_Api.initOpenApi(initParams);
         LCOpenSDK_DeviceInit.getInstance();
         sdkHasInit = true;
@@ -83,11 +97,12 @@
         //寮�鍚坊鍔犻〉闈�
         activity.startActivity(new Intent(commonParam.getContext(), DeviceAddActivity.class));
     }
-    public void setSubAccessToken(String subAccessToken){
+
+    public void setSubAccessToken(String subAccessToken) {
         this.subAccessToken = subAccessToken;
     }
 
-    public boolean deviceOnlineChangeNet(Activity activity,DHDevice device, CurWifiInfo wifiInfo)  {
+    public boolean deviceOnlineChangeNet(Activity activity, DHDevice device, CurWifiInfo wifiInfo) {
         if (!sdkHasInit) {
             return false;
         }
@@ -145,4 +160,18 @@
         ImageLoader.getInstance().init(config);
     }
 
+    public String getHomeId() {
+        return homeId == null ? "" : homeId;
+    }
+
+    public void setHomeId(String homeId) {
+        this.homeId = homeId;
+    }
+
+    private String productBrandldentity;
+    public String getProductBrandldentity() { return productBrandldentity == null ? "" : productBrandldentity;}
+
+    public void setProductBrandldentity(String productBrandldentity){
+        this.productBrandldentity = productBrandldentity;
+    }
 }

--
Gitblit v1.8.0