Merge pull request #899 from MilosKozak/xDrip-source
xDrip plugin depend filtering on source
This commit is contained in:
commit
0b8ff8fa76
3 changed files with 11 additions and 2 deletions
|
@ -197,7 +197,8 @@ public class DataService extends IntentService {
|
||||||
bgReading.direction = bundle.getString(Intents.EXTRA_BG_SLOPE_NAME);
|
bgReading.direction = bundle.getString(Intents.EXTRA_BG_SLOPE_NAME);
|
||||||
bgReading.date = bundle.getLong(Intents.EXTRA_TIMESTAMP);
|
bgReading.date = bundle.getLong(Intents.EXTRA_TIMESTAMP);
|
||||||
bgReading.raw = bundle.getDouble(Intents.EXTRA_RAW);
|
bgReading.raw = bundle.getDouble(Intents.EXTRA_RAW);
|
||||||
|
String source = bundle.getString(Intents.XDRIP_DATA_SOURCE_DESCRIPTION, "no Source specified");
|
||||||
|
SourceXdripPlugin.getPlugin().setSource(source);
|
||||||
MainApp.getDbHelper().createIfNotExists(bgReading, "XDRIP");
|
MainApp.getDbHelper().createIfNotExists(bgReading, "XDRIP");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ public interface Intents {
|
||||||
String EXTRA_SENSOR_BATTERY = "com.eveningoutpost.dexdrip.Extras.SensorBattery";
|
String EXTRA_SENSOR_BATTERY = "com.eveningoutpost.dexdrip.Extras.SensorBattery";
|
||||||
String EXTRA_TIMESTAMP = "com.eveningoutpost.dexdrip.Extras.Time";
|
String EXTRA_TIMESTAMP = "com.eveningoutpost.dexdrip.Extras.Time";
|
||||||
String EXTRA_RAW = "com.eveningoutpost.dexdrip.Extras.Raw";
|
String EXTRA_RAW = "com.eveningoutpost.dexdrip.Extras.Raw";
|
||||||
|
String XDRIP_DATA_SOURCE_DESCRIPTION = "com.eveningoutpost.dexdrip.Extras.SourceDesc";
|
||||||
|
|
||||||
|
|
||||||
String ACTION_NEW_BG_ESTIMATE_NO_DATA = "com.eveningoutpost.dexdrip.BgEstimateNoData";
|
String ACTION_NEW_BG_ESTIMATE_NO_DATA = "com.eveningoutpost.dexdrip.BgEstimateNoData";
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@ import info.nightscout.androidaps.interfaces.PluginType;
|
||||||
public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
|
public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
|
||||||
|
|
||||||
private static SourceXdripPlugin plugin = null;
|
private static SourceXdripPlugin plugin = null;
|
||||||
|
|
||||||
|
boolean advancedFiltering;
|
||||||
|
|
||||||
public static SourceXdripPlugin getPlugin() {
|
public static SourceXdripPlugin getPlugin() {
|
||||||
if (plugin == null)
|
if (plugin == null)
|
||||||
|
@ -29,6 +31,10 @@ public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean advancedFilteringSupported() {
|
public boolean advancedFilteringSupported() {
|
||||||
return false;
|
return advancedFiltering;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource(String source) {
|
||||||
|
this.advancedFiltering = "G5 Native".equals(source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue