Browse Source

045代码上传

zhangshenjie 1 year ago
parent
commit
d4b6b63c4c

+ 2 - 0
BusinessSetting/src/main/java/com/develop/setting/ui/LanguageActivity.kt

@@ -21,6 +21,7 @@ import com.develop.base.ext.setVisible
 import com.develop.base.ext.updateText
 import com.develop.base.mvvm.BaseBindingActivity
 import com.develop.base.util.MMkvUtils
+import com.develop.base.util.SerialportUtils
 import com.develop.common.data_repo.db.DataFactory
 import com.develop.common.data_repo.db.LanguageModel
 import com.develop.common.event.FinishAtyEvent
@@ -203,6 +204,7 @@ class LanguageActivity : BaseBindingActivity<ActivityLanguageBinding>() {
         binding.languageRecycle.models?.get(index)?.apply {
             var l = this as ConfigUtils.Lang;
             MMkvUtils.save(CURRENT_LANGUAGE, l.value)
+            SerialportUtils.updateLanguage(Locale(l.value.lowercase(),l.value.uppercase()))
             LanguageUtils.applyLanguage(Locale(l.value.lowercase(),l.value.uppercase()))
         }
     }

+ 1 - 0
BusinessSetting/src/main/res/layout/activity_restore.xml

@@ -39,6 +39,7 @@
         android:layout_centerHorizontal="true"
         android:layout_marginTop="@dimen/convert_400px"
         android:includeFontPadding="false"
+        android:gravity="center"
         android:text="@string/are_you_sure_to_restore_factory_settings"
         android:textColor="@color/restore_des"
         android:textSize="@dimen/convert_45px" />

+ 1 - 1
BusinessStep/src/main/res/layout/activity_mode_detail.xml

@@ -204,7 +204,7 @@
             android:id="@+id/temp_ring_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="80°C"
+            android:text="0°C"
             android:textColor="@color/temp_ring"
             android:textSize="@dimen/convert_72px"
             app:layout_constraintBottom_toBottomOf="@+id/temp_ring_view"

+ 7 - 4
app/build.gradle

@@ -13,8 +13,8 @@ ext{
     versionCode=Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
 //    versionCode=230617180
 //    brandCode="036I"
-    brandCode="017A"
-    model="5037"
+    brandCode="032A"
+    model="1039"
 
 }
 
@@ -229,10 +229,13 @@ android {
 
         debug{
             debuggable true
-            productFlavors.brand017ATuya.signingConfig signingConfigs.debug
+            productFlavors.brand032DTuya.signingConfig signingConfigs.debug
 //            buildConfigField("String", "UpdatePlatform", "\"054A\"")
-////            buildConfigField("String", "FLAVOR", "\"brand054ATuya\"")
+//////            buildConfigField("String", "FLAVOR", "\"brand054ATuya\"")
 //            resValue("string", "app_theme", "@style/Splash054ATheme")
+
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/Splash032DTheme")
         }
     }
 

+ 59 - 0
app/src/main/java/com/develop/foodcooking/FoodCookingApp.kt

@@ -74,6 +74,7 @@ class FoodCookingApp : BaseApp() {
     private lateinit var pm: PowerManager
     var minute = 0
     private  var heartBeatInterval :Interval?=null
+    var ledLock = false
     override fun onCreate() {
 
         hookWebView()
@@ -252,6 +253,64 @@ class FoodCookingApp : BaseApp() {
                 sendBroadcast(intent)
             }
         }
+
+        if (!ledLock) {
+            ledLock = true;
+            if (!pm.isScreenOn) {
+
+                //合盖
+                if (devInfo.potCloverStatus.toInt() == 0) {
+                    CofarSDK.flashWhiteRedLed()
+                } else {
+                    CofarSDK.switchWhiteLed('0');
+                    CofarSDK.flashRedLed()
+                }
+
+            } else {
+                if (devInfo.status == DevStatus.STOP.toInt()) {
+
+                    if (devInfo.potStatus.toInt() == 0) {
+                        if (devInfo.potCloverStatus.toInt() == 0) {
+                            CofarSDK.flashWhiteRedLed()
+                        } else {
+                            CofarSDK.switchWhiteLed('0');
+                            CofarSDK.flashRedLed()
+                        }
+                    } else {
+                        CofarSDK.switchWhiteLed('0');
+                        CofarSDK.flashRedLed();
+                    }
+
+                }
+
+                if (devInfo.status == DevStatus.RUNNING.toInt()) {
+
+                    if (devInfo.temp < 60) {
+                        CofarSDK.switchRedLed('0');
+                        CofarSDK.switchWhiteLed('1');
+                    } else {
+                        CofarSDK.switchRedLed('1');
+                        CofarSDK.switchWhiteLed('0');
+                    }
+
+                }
+
+                if (devInfo.status == DevStatus.PAUSE.toInt()) {
+
+                    //判断盖子是否打开
+                    //合盖
+                    if (devInfo.potCloverStatus.toInt() == 1) {
+                        CofarSDK.switchWhiteLed('0');
+                        CofarSDK.flashRedLed()
+                    } else {
+                        CofarSDK.flashWhiteRedLed()
+                    }
+
+
+                }
+            }
+            ledLock = false;
+        }
         GlobalDevEvent.globalCoverEvent(event, pm)
     }
 }

+ 1 - 0
libBase/src/main/java/com/develop/base/ext/GlobaExt.kt

@@ -198,6 +198,7 @@ fun getSN(): String {
 //    return  "017A20060020123010190001"
 //    return "010D10390020123010190001"
 //    return "000A10390020123010190009"
+    return  "032D21060020123010190001"
     //通过反射获取sn号
     try {
         val c = Class.forName("android.os.SystemProperties")