Browse Source

删掉不必要代码

zhangshenjie 2 months ago
parent
commit
fa8cd1c22d

+ 0 - 128
BusinessCommon/src/main/java/com/develop/common/utils/TuyaUtilsSo.java

@@ -589,133 +589,6 @@ public class TuyaUtilsSo {
     }
 
 
-    public void uploadDataBuffer(BaseDevMode baseDevMode) {
-        if (!tuyaNetwork) {
-            return;
-        }
-
-
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                DevInfo info = CofarSDK.devInfo();
-                BaseDevMode mode = info.getMode();
-                int time = (int) System.currentTimeMillis();
-                Log.v("tuya_iot", info.toString());
-//                BaseDevMode mode = baseDevMode;
-//                Log.e("tuya_iot",mode.toString());
-                int status = info.getStatus();
-                //getStatus    0 stop  1 start  2 pause
-                int start_stop = status == 0 ? 0 : 1;   // 这里有个暂停,个人认为,暂停算是运行的一部分
-                int pause = status == 2 ? 1 : 0;
-                int pot_status = 0;
-                if (info.getDevMode().equals("SOUP")) {
-                    pot_status = 0;
-                } else if (info.getDevMode().equals("AIR_FRYER")) {
-                    pot_status = 1;
-                } else if (info.getDevMode().equals("STAND_MIXER")) {
-                    pot_status = 3;
-                } else {
-                    pot_status = 0;
-                }
-                int work_state = 0;
-                if (status == 0) {
-                    work_state = 0;
-                } else if (status == 1) {
-                    work_state = 3;
-                } else if (status == 2) {
-                    work_state = 2;
-                }
-
-
-                int timeChange = 1;
-                int tempChange = 1;
-                int motorGearChange = 1;
-                int motorDirectionChange = 1;
-                if (mode == null) {
-                } else {
-                    timeChange = mode.isTimeChange() ? 1 : 0;
-                    tempChange = mode.isTempChange() ? 1 : 0;
-                    motorGearChange = mode.isMotorGearChange() ? 1 : 0;
-                    motorDirectionChange = mode.isMotorDirectionChange() ? 1 : 0;
-                }
-
-
-                int automatic = getModes(info.getRunningInstId());
-
-
-
-                List<DPEvent> dpEvents = new ArrayList<>(Arrays.asList(
-                        new DPEvent(TuyaSoDp.ON_OFF, (byte) DPEvent.Type.PROP_BOOL, 1, 0),
-                        new DPEvent(TuyaSoDp.START_STOP, (byte) DPEvent.Type.PROP_BOOL, start_stop, 0),
-                        new DPEvent(TuyaSoDp.AUTOMATIC_PROGRAM, (byte) DPEvent.Type.PROP_ENUM, automatic, 0),
-                        new DPEvent(TuyaSoDp.WORK_STATE, (byte) DPEvent.Type.PROP_ENUM, work_state, 0),
-                        new DPEvent(TuyaSoDp.COOKING_TEMPERATURE, (byte) DPEvent.Type.PROP_VALUE, mode.getDefaultTemp(), 0),
-                        new DPEvent(TuyaSoDp.CURRENT_TEMPERATURE, (byte) DPEvent.Type.PROP_VALUE, (int) CofarUtils.parseTemp(info.getTemp()), 0),
-                        new DPEvent(TuyaSoDp.COOKING_TIME, (byte) DPEvent.Type.PROP_VALUE, mode.getDefaultTime(), 0),
-                        new DPEvent(TuyaSoDp.REMAINING_TIME, (byte) DPEvent.Type.PROP_VALUE, info.getRemainTime(), 0),
-                        new DPEvent(TuyaSoDp.PAUSE, (byte) DPEvent.Type.PROP_BOOL, pause, 0),
-                        new DPEvent(TuyaSoDp.SPEED, (byte) DPEvent.Type.PROP_VALUE, mode.getDefaultMotorGear(), 0),
-                        new DPEvent(TuyaSoDp.REVERSIBLE, (byte) DPEvent.Type.PROP_BOOL, mode.getMotorDirection(), 0),
-                        new DPEvent(TuyaSoDp.POT_STATUS, (byte) DPEvent.Type.PROP_VALUE, pot_status, 0),
-                        new DPEvent(TuyaSoDp.POT_CLOVER_STATUS, (byte) DPEvent.Type.PROP_VALUE, (int) info.getPotCloverStatus(), 0),
-                        new DPEvent(TuyaSoDp.MAX_TIME, (byte) DPEvent.Type.PROP_VALUE, mode == null ? 0 : mode.getMaxTime(), 0),
-                        new DPEvent(TuyaSoDp.MIN_TIME, (byte) DPEvent.Type.PROP_VALUE, mode == null ? 0 : mode.getMinTime(), 0),
-                        new DPEvent(TuyaSoDp.MAX_TEMP, (byte) DPEvent.Type.PROP_VALUE, mode == null ? 0 : mode.getMaxTemp(), 0),
-                        new DPEvent(TuyaSoDp.MIN_TEMP, (byte) DPEvent.Type.PROP_VALUE, mode == null ? 0 : mode.getMinTemp(), 0),
-                        new DPEvent(TuyaSoDp.MAX_MOTOR_GEAR, (byte) DPEvent.Type.PROP_VALUE, mode == null ? 0 : mode.getMaxMotorGear(), 0),
-                        new DPEvent(TuyaSoDp.MIN_MOTOR_GEAR, (byte) DPEvent.Type.PROP_VALUE, mode == null ? 0 : mode.getMinMotorGear(), 0),
-                        new DPEvent(TuyaSoDp.TIME_CHANGE, (byte) DPEvent.Type.PROP_BOOL, timeChange, 0),
-                        new DPEvent(TuyaSoDp.TEMP_CHANGE, (byte) DPEvent.Type.PROP_BOOL, tempChange, 0),
-                        new DPEvent(TuyaSoDp.MOTOR_GEAR_CHANGE, (byte) DPEvent.Type.PROP_BOOL, motorGearChange, 0),
-                        new DPEvent(TuyaSoDp.MOTOR_DIRECTION_CHANGE, (byte) DPEvent.Type.PROP_BOOL, motorDirectionChange, 0)
-                ));
-
-                if (isWeight) {
-                    dpEvents.add(new DPEvent(TuyaSoDp.WEIGHT_NUMBER, (byte) DPEvent.Type.PROP_VALUE, info.getWeight(), 0));
-                }
-
-
-                /**
-                 * 数值类型需要用  send_dp_value
-                 * 枚举类型需要用  send_dp_enum
-                 * 布尔值类型需要用 send_dp_bool
-                 * */
-
-                //上报指令
-                for (DPEvent event : dpEvents) {
-                    int value = -1;
-                    Object eventValue = event.value;
-                    if (eventValue instanceof Short) {
-                        Short shortValue = (Short) eventValue;
-                        value = shortValue.intValue();
-                    } else if (eventValue instanceof Integer) {
-                        value = (int) eventValue;
-                    } else if (eventValue instanceof Byte) {
-                        Byte byteValue = (Byte) eventValue;
-                        value = byteValue.intValue();
-                    } else {
-                        value = (int) eventValue;
-                    }
-
-                    if (event.type == DPEvent.Type.PROP_BOOL) {
-                        sendDpBool(event.dpid, value, time);
-                    }
-                    if (event.type == DPEvent.Type.PROP_VALUE) {
-                        sendDpValue(event.dpid, value, time);
-                    }
-                    if (event.type == DPEvent.Type.PROP_STR) {
-                        sendDpStr(event.dpid, String.valueOf(value), time);
-                    }
-                    if (event.type == DPEvent.Type.PROP_ENUM) {
-                        sendDpEnum(event.dpid, value, time);
-                    }
-
-                }
-            }
-        }).start();
-//        ioTSDKManager.sendDP(dpEvents);
-    }
 
 
 
@@ -884,7 +757,6 @@ public class TuyaUtilsSo {
         //上报成功,避免同一个值重复上报,估在这加map做缓存
         if (code == 0) {
             map.put(dpid, value);
-
         }
 
     }

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

@@ -225,9 +225,9 @@ fun getSN(): String {
 //        return "011D10390020123010190001"
 //        return "011A10390020123010190002"
 //        return "011A10390020123010190002"
-        return  "011D10390020123010190021";
-//        return  "011D10390020123010190088";
-//        return  "011D10390020123010190003"
+//        return  "011D10390020123010190021"
+//        return  "011D10390020123010190088"
+        return  "011D10390020123010190003"
 //        return  "011A10390020123010190188"
 //        return "011A10390020123010190099"
 //        return "011A10390020123010190009"