From: TrillGates Date: Thu, 18 Nov 2021 03:08:29 +0000 (+0800) Subject: 闹钟单次,后台下发功能实现 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=dbe65d6e277e518bab6f83e31056f0233e8de164;p=icsupport.git 闹钟单次,后台下发功能实现 --- diff --git a/app/src/main/java/com/ic/protocols/protocol_s123.java b/app/src/main/java/com/ic/protocols/protocol_s123.java index 6de6becd..bf35e857 100644 --- a/app/src/main/java/com/ic/protocols/protocol_s123.java +++ b/app/src/main/java/com/ic/protocols/protocol_s123.java @@ -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); }