3 Commits c83441dc09 ... 1b99da49d5

Autor SHA1 Mensagem Data
  wbspool 1b99da49d5 Merge remote-tracking branch 'origin/landscape_main' into landscape_main 1 ano atrás
  wbspool 74ff83f3bf sdk更新 1 ano atrás
  wbspool c06e8437cf 添加034A打包配置 1 ano atrás

+ 20 - 0
BusinessAirFryer/src/main/assets/tuya_config.json

@@ -115,6 +115,26 @@
       "uid": "uuidcc01214733d60dec",
       "ak": "d8VA2BnPgQoHJL98UcSzMrATvYmFjnck"
     },
+    "000A10390020123010190011": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid1a3173102ec7297d",
+      "ak": "WwRyqI7dPt5ymWwEEgDfpj7qDHxuavvW"
+    },
+    "000A10390020123010190012": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuiddc725f67a649312d",
+      "ak": "wXJYOjFRWWkmVEOyd5OdXOAatTo0be1R"
+    },
+    "000A10390020123010190013": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid9a548bc824c5e2b9",
+      "ak": "rxR958Jqu5amgXvGLcpgJG6OFIwLEPaj"
+    },
+    "000A20080020123010190001": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuide4ebd69311eab54e",
+      "ak": "96cTOSOPxvvcExlyJJe7NrkLaucr0As2"
+    },
     "000A21010020123010190001": {
       "pid": "wy8ogbhchnzkmrup",
       "uid": "uuid61a37ca17e67cbc3",

+ 19 - 36
BusinessCommon/src/main/java/com/develop/common/utils/AppVersionUtil.kt

@@ -2,13 +2,16 @@ package com.develop.common.utils
 
 import android.annotation.SuppressLint
 import android.app.Application
+import android.content.Context
 import android.net.Uri
 import android.os.PowerManager
 import android.provider.Settings
+import androidx.core.content.ContextCompat.getSystemService
 import com.azhon.appupdate.listener.OnDownloadListener
 import com.azhon.appupdate.util.LogUtil
 import com.blankj.utilcode.util.FileUtils
 import com.blankj.utilcode.util.ZipUtils
+import com.develop.base.ext.fromJson
 import com.develop.base.ext.globalApp
 import com.develop.base.util.FileKit
 import com.develop.base.util.GlobalToast
@@ -26,7 +29,6 @@ import com.develop.common.data_repo.net.model.response.RecipeDataConfig
 import com.develop.common.dialog.CancelConfirmDialog
 import com.develop.common.dialog.CommonDialog
 import com.develop.common.dialog.RecipeUpdateDialog
-import com.develop.common.event.RefreshDataEvent
 import com.develop.common.tag.SCREENSAVER
 import com.drake.net.Get
 import com.drake.net.Post
@@ -60,13 +62,15 @@ object AppVersionUtil {
                         cancelConfirmDialog.title =
                             getString(com.develop.common.R.string.update_title)
                         cancelConfirmDialog.showDialog(
-                            supportFragmentManager, "cancelConfirmDialog"
+                            supportFragmentManager,
+                            "cancelConfirmDialog"
                         )
                         cancelConfirmDialog.onDialogClickListener =
                             object : CancelConfirmDialog.OnDialogClickListener {
                                 override fun onConfirm() {
                                     commonDialog.showDialog(supportFragmentManager, "commonDialog")
-                                    UpdateUtil.updateApp(this@apply,
+                                    UpdateUtil.updateApp(
+                                        this@apply,
                                         result.apkUrl,
                                         object : OnDownloadListener {
                                             override fun cancel() {
@@ -198,27 +202,8 @@ object AppVersionUtil {
 
         TopResumedAtyHolder.getCurrentActivity()?.apply {
             if (newRecipes.isEmpty()) {
-                saveRecipeUpdateTime(recipeUpdateTime)
-                scopeNetLife {
-                    //判断是否还有新菜谱
-                    val result = Post<DevInfoResult>(Api.DEV_INFO) {
-                        body = DeviceInfoBody.genDeviceInfoBody()
-                    }.await()
-
-                    val ut = result.recipeUpdateTime
-                    val nr = LinkedList(result.newRecipes)
-                    if (!nr.isEmpty()) {
-                       downloadRecipes(nr,recipeUpdateDialog,
-                           nr.size.toLong(),downloadDir,downloadName,ut)
-                        return@scopeNetLife
-                    }else{
-                        recipeUpdateDialog.removeSelf()
-                        showRecipesUpdateDialog(recipeUpdateTime)
-                    }
-                }
-
-
-
+                recipeUpdateDialog.removeSelf()
+                showRecipesUpdateDialog(recipeUpdateTime)
                 return
             }
 
@@ -276,7 +261,7 @@ object AppVersionUtil {
             }
             val jsonContent = FileKit.readFileToStringB(jsonFile)
             val contentData = jsonDecoder.decodeFromString<RecipeDataConfig>(jsonContent)
-            // contentData.resetAllCodes()
+            contentData.resetAllCodes()
             FoodDataProvider.getDatabase().runInTransaction {
                 FoodDataProvider.getDatabase().recipeDao().apply {
 
@@ -322,29 +307,27 @@ object AppVersionUtil {
     }
 
 
-    private fun saveRecipeUpdateTime(recipeUpdateTime: Long?) {
-        val v =
-            FoodDataProvider.getUserDatabase().devConfigDao().recipeVersion() ?: DevVersion(0, 0)
-        v.recipeUpdateTime = recipeUpdateTime
-        FoodDataProvider.getUserDatabase().devConfigDao().saveDevVersion(v)
-    }
-
     private fun showRecipesUpdateDialog(recipeUpdateTime: Long?) {
         TopResumedAtyHolder.getCurrentActivity()?.apply {
             val minute = MMkvUtils.getInt(SCREENSAVER)
             if (minute != 0) {
                 Settings.System.putInt(
-                    contentResolver, Settings.System.SCREEN_OFF_TIMEOUT, 1000 * 60 * minute
+                    contentResolver,
+                    Settings.System.SCREEN_OFF_TIMEOUT,
+                    1000 * 60 * minute
                 )
-                val uri: Uri = Settings.System.getUriFor(Settings.System.SCREEN_OFF_TIMEOUT)
+                val uri: Uri = Settings.System
+                    .getUriFor(Settings.System.SCREEN_OFF_TIMEOUT)
                 contentResolver.notifyChange(uri, null)
             }
             EventBus.getDefault().post(NoScreenEvent(false))
-            EventBus.getDefault().post(RefreshDataEvent())
             RecipeUpdateDialog().apply {
                 onDialogClickListener = object : RecipeUpdateDialog.OnDialogClickListener {
                     override fun onConfirm() {
-                        saveRecipeUpdateTime(recipeUpdateTime)
+                        val v = FoodDataProvider.getUserDatabase().devConfigDao().recipeVersion()
+                            ?: DevVersion(0, 0)
+                        v.recipeUpdateTime = recipeUpdateTime
+                        FoodDataProvider.getUserDatabase().devConfigDao().saveDevVersion(v)
                         removeSelf()
                     }
 

+ 4 - 3
BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt

@@ -488,16 +488,17 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
 
         if("change_temp" == event.type){
 
-            ThreadUtils.runOnMainThread {
+            ThreadUtils.runOnMainThread ({
                 updateTempUI(
                     minTemp.toFloat(),
                     maxTemp.toFloat(),
                     if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt()
                     else currDevInfo.temp.toInt(),
                     if (currDevInfo.targetTempBuffer.toInt() != -1 ) currDevInfo.targetTempBuffer.toString() else currDevInfo.targetTemp.toString(),
-                    isTempChange
+                    isTempChange,
+                    focusUpdate = true
                 )
-            }
+            },500)
 
         }
 

BIN
libThirdPart/libs/cofar-cooking-device-sdk-0.0.1-SNAPSHOT.jar