|
@@ -19,6 +19,7 @@ import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevModes;
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus;
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.constant.core.HeatModes;
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.constant.core.MotorDirections;
|
|
|
+import com.kuyuntech.cofarcooking.device.sdk.devmode.core.BaseDevMode;
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.eventbus.core.DevInfo;
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK;
|
|
|
import com.tuya.smartai.iot_sdk.DPEvent;
|
|
@@ -78,6 +79,8 @@ public class TuyaUtils {
|
|
|
|
|
|
DevInfo info = CofarSDK.devInfo();
|
|
|
|
|
|
+ BaseDevMode mode = info.getMode();
|
|
|
+
|
|
|
DPEvent[] dpEvents = new DPEvent[]{
|
|
|
new DPEvent(TuyaDps.DEV_MODE,(byte) DPEvent.Type.PROP_VALUE,devMode,0),
|
|
|
new DPEvent(TuyaDps.CURRENT_PRESSURE_COOKER,(byte) DPEvent.Type.PROP_VALUE,-1,0),
|
|
@@ -90,12 +93,22 @@ public class TuyaUtils {
|
|
|
new DPEvent(TuyaDps.MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getMotorGearBuffer() != -1 ? info.getMotorGearBuffer() : info.getMotorGear()),0),
|
|
|
new DPEvent(TuyaDps.MOTOR_DIRECTION,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getMotorDirectionBuffer() != -1 ? info.getMotorDirectionBuffer():info.getMotorDirection()),0),
|
|
|
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,-1),
|
|
|
+ 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.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),
|
|
|
+ new DPEvent(TuyaDps.MAX_TIME,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxTime(),0),
|
|
|
+ new DPEvent(TuyaDps.MIN_TIME,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinTime(),0),
|
|
|
+ new DPEvent(TuyaDps.MAX_TEMP,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxTemp(),0),
|
|
|
+ new DPEvent(TuyaDps.MIN_TEMP,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinTemp(),0),
|
|
|
+ new DPEvent(TuyaDps.MAX_MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxMotorGear(),0),
|
|
|
+ new DPEvent(TuyaDps.MIN_MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinMotorGear(),0),
|
|
|
+ new DPEvent(TuyaDps.MAX_SPRAY_WATER,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxWaterGear(),0),
|
|
|
+ new DPEvent(TuyaDps.MIN_MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinMotorGear(),0),
|
|
|
+
|
|
|
+
|
|
|
};
|
|
|
|
|
|
|