Merge pull request #1710 from TebbeUbben/insight-fix

Insight: Fix automatic Careportal entries
This commit is contained in:
Milos Kozak 2019-04-03 16:10:03 +02:00 committed by GitHub
commit 64c9196a5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View file

@ -1189,6 +1189,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
} }
private void processCannulaFilledEvent(CannulaFilledEvent event) { private void processCannulaFilledEvent(CannulaFilledEvent event) {
if (!SP.getBoolean("insight_log_site_changes", false)) return;
long timestamp = parseDate(event.getEventYear(), event.getEventMonth(), event.getEventDay(), long timestamp = parseDate(event.getEventYear(), event.getEventMonth(), event.getEventDay(),
event.getEventHour(), event.getEventMinute(), event.getEventSecond()) + timeOffset; event.getEventHour(), event.getEventMinute(), event.getEventSecond()) + timeOffset;
uploadCareportalEvent(timestamp, CareportalEvent.SITECHANGE); uploadCareportalEvent(timestamp, CareportalEvent.SITECHANGE);
@ -1216,7 +1217,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
} }
private void processSniffingDoneEvent(SniffingDoneEvent event) { private void processSniffingDoneEvent(SniffingDoneEvent event) {
if (!SP.getBoolean("insight_log_site_changes", false)) return; if (!SP.getBoolean("insight_log_reservoir_changes", false)) return;
long timestamp = parseDate(event.getEventYear(), event.getEventMonth(), event.getEventDay(), long timestamp = parseDate(event.getEventYear(), event.getEventMonth(), event.getEventDay(),
event.getEventHour(), event.getEventMinute(), event.getEventSecond()) + timeOffset; event.getEventHour(), event.getEventMinute(), event.getEventSecond()) + timeOffset;
uploadCareportalEvent(timestamp, CareportalEvent.INSULINCHANGE); uploadCareportalEvent(timestamp, CareportalEvent.INSULINCHANGE);

View file

@ -1253,6 +1253,7 @@
<string name="mute_alert">Mute</string> <string name="mute_alert">Mute</string>
<string name="pump_alert">Pump alert</string> <string name="pump_alert">Pump alert</string>
<string name="log_site_changes">Log site changes</string> <string name="log_site_changes">Log site changes</string>
<string name="log_reservoir_changes">Log reservoir changes</string>
<string name="log_tube_changes">Log tube changes</string> <string name="log_tube_changes">Log tube changes</string>
<string name="log_battery_changes">Log battery changes</string> <string name="log_battery_changes">Log battery changes</string>
<string name="log_operating_mode_changes">Log operating mode changes</string> <string name="log_operating_mode_changes">Log operating mode changes</string>

View file

@ -10,14 +10,19 @@
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="insight_log_site_changes" android:key="insight_log_reservoir_changes"
android:title="@string/log_site_changes" /> android:title="@string/log_reservoir_changes" />
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="insight_log_tube_changes" android:key="insight_log_tube_changes"
android:title="@string/log_tube_changes" /> android:title="@string/log_tube_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_site_changes"
android:title="@string/log_site_changes" />
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="insight_log_battery_changes" android:key="insight_log_battery_changes"