闹钟单次,后台下发功能实现
authorTrillGates <williamtrillgates@gmail.com>
Thu, 18 Nov 2021 03:08:29 +0000 (11:08 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Thu, 18 Nov 2021 03:08:29 +0000 (11:08 +0800)
app/src/main/java/com/ic/protocols/protocol_s123.java

index 6de6bec..bf35e85 100644 (file)
@@ -1435,9 +1435,17 @@ public class protocol_s123 {
                             } else if (alarmtype == 3) {
                                 alarmName = context.getString(R.string.alarm_sit_too_long_tips_text);
                             }
+                            String status = "ON";
+                            if ("0".equals(alarmswitch)) {
+                                status = "OFF";
+                            } else if ("1".equals(alarmswitch)) {
+                                status = "ON";
+                            } else if ("2".equals(alarmswitch)) {
+                                status = "ONCE";
+                            }
                             alarmList.add(new Alarm("ST" + alarmtime.substring(0, 2) + "." + alarmtime.substring(2),
                                     "W" + repeat, "CON",
-                                    alarmswitch == 1 ? "ON" : "OFF", alarmName));
+                                    status, alarmName));
                         } catch (Exception e) {
                             ICLogger.e(e.getMessage(), e);
                         }
@@ -1468,7 +1476,16 @@ public class protocol_s123 {
                                     .toString()
                             );
 
-                            alarmList.add(new Alarm("ST" + alarmtime.substring(0, 2) + "." + alarmtime.substring(2), "W" + repeat, "CON", alarmswitch == 1 ? "ON" : "OFF", "闹铃"));
+                            String status = "ON";
+                            if ("0".equals(alarmswitch)) {
+                                status = "OFF";
+                            } else if ("1".equals(alarmswitch)) {
+                                status = "ON";
+                            } else if ("2".equals(alarmswitch)) {
+                                status = "ONCE";
+                            }
+                            alarmList.add(new Alarm("ST" + alarmtime.substring(0, 2) + "." + alarmtime.substring(2), "W" + repeat, "CON",
+                                    status, "闹铃"));
                         } catch (Exception e) {
                             ICLogger.e(e.getMessage(), e);
                         }