wbspool 1 tahun lalu
induk
melakukan
ead8735812

+ 1 - 1
BusinessCommon/src/main/java/com/develop/common/food_sdk/FoodSdkUtils.kt

@@ -10,7 +10,7 @@ object FoodSdkUtils {
     }
 
     fun parseTemp(temp: Short): Short {
-        return if (temp <= 37 && temp.toInt() != 0) {
+        return if (temp <= 35 && temp.toInt() != 0) {
             37
         } else {
             CofarSDK.parseTemp(temp)

+ 2 - 0
BusinessCommon/src/main/java/com/develop/common/utils/CommonUtils.kt

@@ -82,12 +82,14 @@ object  CommonUtils {
         if(DevModes.SOUP == CofarSDK.devInfo().devMode){
             val bundle = Bundle()
             bundle.putString(MODE_TYPE, WorkModes.ADAPTED_COOKING)
+            bundle.putString("OP_MODE","APP")
             TopResumedAtyHolder.getCurrentActivity()?.navigateTo(Screens.Cook.COOK_MODES) {
                 with(bundle)
             }
         }else if (DevModes.AIR_FRYER == CofarSDK.devInfo().devMode){
             val bundle = Bundle()
             bundle.putString(MODE_TYPE, WorkModes.AF_DIY)
+            bundle.putString("OP_MODE","APP")
             TopResumedAtyHolder.getCurrentActivity()?.navigateTo(Screens.Cook.COOK_MODES) {
                 with(bundle)
             }

+ 1 - 1
BusinessCommon/src/main/java/com/develop/common/utils/TuyaUtils.java

@@ -95,7 +95,7 @@ public class TuyaUtils {
           new DPEvent(TuyaDps.SPRAY_WATER,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getWaterGearBuffer() != -1 ? info.getWaterGearBuffer() : info.getWaterGear()),0),
           new DPEvent(TuyaDps.WIND_SPEED,(byte) DPEvent.Type.PROP_VALUE,1,0),
           new DPEvent(TuyaDps.TARGET_TEMP,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getTargetTempBuffer() != -1 ? info.getTargetTempBuffer():info.getTargetTemp()),0),
-          new DPEvent(TuyaDps.CURRENT_TEMP,(byte) DPEvent.Type.PROP_VALUE,(int)info.getTemp(),0),
+          new DPEvent(TuyaDps.CURRENT_TEMP,(byte) DPEvent.Type.PROP_VALUE,(int)CofarUtils.parseTemp(info.getTemp()),0),
           new DPEvent(TuyaDps.POT_CLOVER_STATUS,(byte) DPEvent.Type.PROP_VALUE,(int)info.getPotCloverStatus(),0),
           new DPEvent(TuyaDps.POT_STATUS,(byte) DPEvent.Type.PROP_VALUE,(int)info.getPotStatus(),0),
           new DPEvent(TuyaDps.DEV_READY,(byte) DPEvent.Type.PROP_VALUE,CommonUtils.INSTANCE.devReady() ? 0 : 1,0),

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

@@ -56,6 +56,7 @@ import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
 import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
 import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
+import java.util.Objects
 
 /**
  * 模式详情页
@@ -96,6 +97,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
     private var canStart = true
     private var whereIndex = -1
     private var modeName = ""
+    private var opMode = "HAND"
     lateinit var ctx: Context
 
     private val backRequestDialog by lazy {
@@ -153,6 +155,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         turnDevModeUI();
         viewModel.modeType = intent.extras?.getString(MODE_TYPE, ModesType.CHOP.name) ?: ""
         modeName = intent.extras?.getString("mode_name", "") ?: ""
+        opMode =  intent.extras?.getString("OP_MODE", "HAND") ?: "HAND"
         viewModel.lastModeType = viewModel.modeType
         lastModeType = viewModel.modeType
         modeType = lastModeType
@@ -394,9 +397,8 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
                  CofarSDK.confirm()
                  resumeClick()
              }else{
-                 startClick()
+                 startClick(false)
              }
-
          }
 
         if("stop" == event.type){
@@ -1610,14 +1612,16 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
     /**
      * 点击开始操作
      */
-    private fun startClick() {
+    private fun startClick(showStopTips:Boolean=true) {
         if (mRunningInstId != mSettingInstId) {
             overrideModeDialog.showDialog(supportFragmentManager, "overrideModeDialog")
         } else {
             userChanging = false
             CofarSDK.cancel()
             CofarSDK.devInfo().runningRecipeId = null
-            CofarSDK.start(viewModel.modeType)
+            var startConfig = HashMap<String, Any>()
+            startConfig.put("stopTips",showStopTips)
+            CofarSDK.startWithConfig(viewModel.modeType,startConfig)
             whereIndex = -1
             binding.clSetTime.stopAlphaAnim()
         }

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