|
@@ -1,5 +1,7 @@
|
|
|
package com.develop.common.utils;
|
|
|
|
|
|
+import static com.develop.common.tag.CommonTagKt.HISTORYRECIPES;
|
|
|
+
|
|
|
import android.content.Context;
|
|
|
import android.os.PowerManager;
|
|
|
import android.util.Log;
|
|
@@ -221,9 +223,13 @@ public class TuyaUtilsSo {
|
|
|
}
|
|
|
|
|
|
isUser = true;
|
|
|
- //烹饪温度
|
|
|
- CofarSDK.cfgHeat((short) (int) intValue, mode);
|
|
|
- tuyaEvent("change_temp");
|
|
|
+ DevInfo infoTemp = CofarSDK.devInfo();
|
|
|
+ BaseDevMode modesTemp = infoTemp.getMode();
|
|
|
+ if (modesTemp.isTempChange()){
|
|
|
+ //烹饪温度
|
|
|
+ CofarSDK.cfgHeat((short) (int) intValue, mode);
|
|
|
+ tuyaEvent("change_temp");
|
|
|
+ }
|
|
|
|
|
|
break;
|
|
|
case TuyaSoDp.PAUSE:
|
|
@@ -238,9 +244,14 @@ public class TuyaUtilsSo {
|
|
|
break;
|
|
|
case TuyaSoDp.COOKING_TIME:
|
|
|
isUser = true;
|
|
|
- //烹饪时间
|
|
|
- CofarSDK.cfgTime((int) intValue);
|
|
|
- tuyaEvent("change_time");
|
|
|
+ DevInfo infoTime = CofarSDK.devInfo();
|
|
|
+ BaseDevMode modesTime = infoTime.getMode();
|
|
|
+ if (modesTime.isTimeChange()){
|
|
|
+ //烹饪时间
|
|
|
+ CofarSDK.cfgTime((int) intValue);
|
|
|
+ tuyaEvent("change_time");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
break;
|
|
@@ -249,15 +260,24 @@ public class TuyaUtilsSo {
|
|
|
break;
|
|
|
case TuyaSoDp.SPEED:
|
|
|
isUser = true;
|
|
|
+ DevInfo infoGear = CofarSDK.devInfo();
|
|
|
+ BaseDevMode modesGear = infoGear.getMode();
|
|
|
+ if (modesGear.isMotorGearChange()){
|
|
|
+ CofarSDK.cfgMotorGear((byte) intValue);
|
|
|
+ }
|
|
|
//速度
|
|
|
- CofarSDK.cfgMotorGear((byte) intValue);
|
|
|
break;
|
|
|
case TuyaSoDp.REVERSIBLE:
|
|
|
isUser = true;
|
|
|
- //正反转
|
|
|
- CofarSDK.cfgMotorDirection((int) boolValue == 0 ? MotorDirections.FORWARD : MotorDirections.REVERSE);
|
|
|
- //按照以前的涂鸦,上面修改转向没有图标没有变动,估在发送一个eventbus
|
|
|
- tuyaEvent("change_direction");
|
|
|
+ DevInfo info = CofarSDK.devInfo();
|
|
|
+ BaseDevMode modes = info.getMode();
|
|
|
+ if (modes.isMotorDirectionChange()){
|
|
|
+ //正反转
|
|
|
+ CofarSDK.cfgMotorDirection((int) boolValue == 0 ? MotorDirections.FORWARD : MotorDirections.REVERSE);
|
|
|
+ //按照以前的涂鸦,上面修改转向没有图标没有变动,估在发送一个eventbus
|
|
|
+ tuyaEvent("change_direction");
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
case TuyaSoDp.WEIGHT_CLEAR:
|
|
|
//称重清零
|
|
@@ -282,7 +302,6 @@ public class TuyaUtilsSo {
|
|
|
if (enumValue == 1) {
|
|
|
autoMaticType = -1;
|
|
|
isWeight = false;
|
|
|
- isUser = false;
|
|
|
CommonTuyaSoUtils.INSTANCE.navigateFinish();
|
|
|
}
|
|
|
break;
|
|
@@ -381,6 +400,9 @@ public class TuyaUtilsSo {
|
|
|
TuyaApi.RestartCallback restartCallback = new TuyaApi.RestartCallback() {
|
|
|
@Override
|
|
|
public void invoke() {
|
|
|
+ //解绑的时候,把历史记录去掉
|
|
|
+ MMkvUtils.INSTANCE.save(HISTORYRECIPES, "");
|
|
|
+
|
|
|
PowerManager pm = (PowerManager) AppActivityManager.getInstance().getTopActivity().getSystemService(Context.POWER_SERVICE);
|
|
|
pm.reboot("");
|
|
|
}
|
|
@@ -458,7 +480,7 @@ public class TuyaUtilsSo {
|
|
|
|
|
|
|
|
|
public void uploadData() {
|
|
|
- if (!tuyaNetwork || !isUser) {
|
|
|
+ if (!tuyaNetwork) {
|
|
|
return;
|
|
|
}
|
|
|
|