Skip to content

Commit

Permalink
getStringToInt
Browse files Browse the repository at this point in the history
  • Loading branch information
Navid200 committed Nov 15, 2023
1 parent 047222b commit 5439078
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static boolean shouldServiceRun() {
*/
public static List<StatusItem> megaStatus() {
final BgReading lastBg = BgReading.lastNoSenssor();
final long lag = Constants.SECOND_IN_MS * Integer.valueOf(Pref.getString("nsfollow_lag", "0")); // Wake delay selected by user
final long lag = Constants.SECOND_IN_MS * Pref.getStringToInt("nsfollow_lag", 0); // Wake delay selected by user

String lastPollText = "n/a";
if (lastPoll > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Anticipate {
*/

public static long next(long now, final long lastTimeStamp, final long period, final long grace) {
final long lag = Constants.SECOND_IN_MS * Integer.valueOf(Pref.getString("nsfollow_lag", "0")); // User can choose a wake delay with a 0 default.
final long lag = Constants.SECOND_IN_MS * Pref.getStringToInt("nsfollow_lag", 0); // User can choose a wake delay with a 0 default.
final long last = lastTimeStamp + lag; // We delay the source timestamp and use it as the time we received the reading to account for any source delay.

final long since = now - last;
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,17 @@
The default is no delay, and is marked with the single symbol > -->
<string-array name="nsfollowlag_entries">
<item>0 ></item>
<item>30 s</item>
<item>40 s</item>
<item>1 min</item>
<item>1.5 min</item>
<item>2 min</item>
<item>3 min</item>
</string-array>
<string-array name="nsfollowlag_values">
<item>0</item>
<item>30</item>
<item>40</item>
<item>60</item>
<item>90</item>
<item>120</item>
<item>180</item>
</string-array>
Expand Down

0 comments on commit 5439078

Please sign in to comment.