diff --git a/app/build.gradle b/app/build.gradle
index e7f17ba92e..42f6ead3c1 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -174,4 +174,5 @@ dependencies {
}
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.guava:guava:20.0'
+ compile project(path: ':ruffyscripter')
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java
index 6de0a4d962..7827490be7 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java
@@ -17,8 +17,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.PumpState;
+import de.jotomo.ruffy.spi.CommandResult;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.PumpCombo.events.EventComboPumpUpdateGUI;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java
index e5570e781c..8b60b61888 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java
@@ -29,11 +29,11 @@ import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.Overview.events.EventOverviewBolusProgress;
import info.nightscout.androidaps.plugins.PumpCombo.events.EventComboPumpUpdateGUI;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.RuffyCommandsV1Impl;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.RuffyCommands;
+import de.jotomo.ruffyscripter.RuffyCommandsV1Impl;
+import de.jotomo.ruffy.spi.BolusProgressReporter;
+import de.jotomo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.PumpState;
+import de.jotomo.ruffy.spi.RuffyCommands;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.SP;
@@ -73,7 +73,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
definePumpCapabilities();
MainApp.bus().register(this);
startAlerter();
- ruffyScripter = RuffyCommandsV1Impl.getInstance();
+ ruffyScripter = RuffyCommandsV1Impl.getInstance(MainApp.instance());
}
private void definePumpCapabilities() {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java
index 83fb0d03fe..8f65a2b1a3 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java
@@ -5,8 +5,8 @@ import android.support.annotation.Nullable;
import java.util.Date;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.PumpState;
+import de.jotomo.ruffy.spi.CommandResult;
class ComboPump {
@Nullable
diff --git a/ruffy-spi/.gitignore b/ruffy-spi/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/ruffy-spi/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/ruffy-spi/build.gradle b/ruffy-spi/build.gradle
new file mode 100644
index 0000000000..f5b6e825c1
--- /dev/null
+++ b/ruffy-spi/build.gradle
@@ -0,0 +1,31 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion "26.0.2"
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:23.4.0'
+ testCompile 'junit:junit:4.12'
+}
diff --git a/ruffy-spi/proguard-rules.pro b/ruffy-spi/proguard-rules.pro
new file mode 100644
index 0000000000..ae0b3241cc
--- /dev/null
+++ b/ruffy-spi/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /home/joe/opt/android/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/ruffy-spi/src/main/AndroidManifest.xml b/ruffy-spi/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..bf60225a83
--- /dev/null
+++ b/ruffy-spi/src/main/AndroidManifest.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/BasalProfile.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BasalProfile.java
similarity index 84%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/BasalProfile.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BasalProfile.java
index d10b7b3078..d24364b8f1 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/BasalProfile.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BasalProfile.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
+package de.jotomo.ruffy.spi;
public class BasalProfile {
public final int number;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/BolusProgressReporter.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BolusProgressReporter.java
similarity index 77%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/BolusProgressReporter.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BolusProgressReporter.java
index f7cdb0d36e..3f19f6b8e9 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/BolusProgressReporter.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BolusProgressReporter.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
+package de.jotomo.ruffy.spi;
public interface BolusProgressReporter {
enum State {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/CommandResult.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/CommandResult.java
similarity index 94%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/CommandResult.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/CommandResult.java
index 57030c9711..f643ab4b19 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/CommandResult.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/CommandResult.java
@@ -1,8 +1,8 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
+package de.jotomo.ruffy.spi;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.PumpHistory;
+import de.jotomo.ruffy.spi.history.PumpHistory;
public class CommandResult {
/** The request made made to the pump, like setting a TBR. */
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/PumpState.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/PumpState.java
similarity index 98%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/PumpState.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/PumpState.java
index 590a63dade..0f8c8f10c5 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/PumpState.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/PumpState.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
+package de.jotomo.ruffy.spi;
import java.util.Date;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/RuffyCommands.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/RuffyCommands.java
similarity index 77%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/RuffyCommands.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/RuffyCommands.java
index 157aecf4e7..0bae05e838 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/RuffyCommands.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/RuffyCommands.java
@@ -1,8 +1,8 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi;
+package de.jotomo.ruffy.spi;
import java.util.Date;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.PumpHistoryRequest;
+import de.jotomo.ruffy.spi.history.PumpHistoryRequest;
public interface RuffyCommands {
CommandResult deliverBolus(double amount, BolusProgressReporter bolusProgressReporter);
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Bolus.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Bolus.java
similarity index 72%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Bolus.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Bolus.java
index c6becb2f3a..0487e857b7 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Bolus.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Bolus.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history;
+package de.jotomo.ruffy.spi.history;
public class Bolus extends HistoryRecord {
public final double amount;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Error.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Error.java
similarity index 85%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Error.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Error.java
index ffb6991926..26b2e26ee0 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Error.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Error.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history;
+package de.jotomo.ruffy.spi.history;
public class Error extends HistoryRecord {
/** Code is an E for error or W for warning, followed by a single digit, e.g. W7 (TBR cancelled). */
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/HistoryRecord.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/HistoryRecord.java
similarity index 69%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/HistoryRecord.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/HistoryRecord.java
index d797f9b43d..32f3d330c4 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/HistoryRecord.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/HistoryRecord.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history;
+package de.jotomo.ruffy.spi.history;
public abstract class HistoryRecord {
public final long timestamp;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/PumpHistory.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/PumpHistory.java
similarity index 72%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/PumpHistory.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/PumpHistory.java
index 22997db28f..341ddcf18c 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/PumpHistory.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/PumpHistory.java
@@ -1,15 +1,10 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history;
+package de.jotomo.ruffy.spi.history;
import android.support.annotation.NonNull;
-import java.lang.*;
import java.util.List;
import java.util.Objects;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.Bolus;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.Tbr;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.Tdd;
-
public class PumpHistory {
public final int reservoirLevel;
@NonNull
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/PumpHistoryRequest.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/PumpHistoryRequest.java
similarity index 94%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/PumpHistoryRequest.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/PumpHistoryRequest.java
index 0a7de024de..994cfe7237 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/PumpHistoryRequest.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/PumpHistoryRequest.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history;
+package de.jotomo.ruffy.spi.history;
/** What data a 'read history' request should return. */
public class PumpHistoryRequest {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Tbr.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tbr.java
similarity index 78%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Tbr.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tbr.java
index effeeebdae..66ceb86630 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Tbr.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tbr.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history;
+package de.jotomo.ruffy.spi.history;
public class Tbr extends HistoryRecord {
public final int duration;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Tdd.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tdd.java
similarity index 77%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Tdd.java
rename to ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tdd.java
index a8226e774b..1086d719a8 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/spi/history/Tdd.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tdd.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history;
+package de.jotomo.ruffy.spi.history;
/** Total daily dosage; amount of insulin delivered over a full day. */
public class Tdd extends HistoryRecord {
diff --git a/ruffyscripter/.gitignore b/ruffyscripter/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/ruffyscripter/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/ruffyscripter/build.gradle b/ruffyscripter/build.gradle
new file mode 100644
index 0000000000..ef9323f4ec
--- /dev/null
+++ b/ruffyscripter/build.gradle
@@ -0,0 +1,34 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion "26.0.2"
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:23.4.0'
+ testCompile 'junit:junit:4.12'
+ compile project(':ruffy-spi')
+ compile 'org.slf4j:slf4j-api:1.7.12'
+ compile 'com.google.guava:guava:20.0'
+}
diff --git a/ruffyscripter/proguard-rules.pro b/ruffyscripter/proguard-rules.pro
new file mode 100644
index 0000000000..ae0b3241cc
--- /dev/null
+++ b/ruffyscripter/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /home/joe/opt/android/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/ruffyscripter/src/main/AndroidManifest.xml b/ruffyscripter/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..80ce73b809
--- /dev/null
+++ b/ruffyscripter/src/main/AndroidManifest.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRTHandler.aidl b/ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRTHandler.aidl
similarity index 99%
rename from app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRTHandler.aidl
rename to ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRTHandler.aidl
index 996b10b666..f17512b8da 100644
--- a/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRTHandler.aidl
+++ b/ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRTHandler.aidl
@@ -2,7 +2,6 @@
package org.monkey.d.ruffy.ruffy.driver;
// Declare any non-default types here with import statements
-
import org.monkey.d.ruffy.ruffy.driver.display.Menu;
interface IRTHandler {
diff --git a/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl b/ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl
similarity index 100%
rename from app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl
rename to ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/IRuffyService.aidl
diff --git a/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/display/Menu.aidl b/ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/display/Menu.aidl
similarity index 100%
rename from app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/display/Menu.aidl
rename to ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/display/Menu.aidl
diff --git a/app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/package-info.java b/ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/package-info.java
similarity index 100%
rename from app/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/package-info.java
rename to ruffyscripter/src/main/aidl/org/monkey/d/ruffy/ruffy/driver/package-info.java
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/RuffyCommandsV1Impl.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyCommandsV1Impl.java
similarity index 65%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/RuffyCommandsV1Impl.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyCommandsV1Impl.java
index 5a16619ec1..05e55b6238 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/RuffyCommandsV1Impl.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyCommandsV1Impl.java
@@ -1,20 +1,21 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy;
+package de.jotomo.ruffyscripter;
+
+import android.content.Context;
import java.util.Date;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BasalProfile;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.PumpHistory;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.RuffyCommands;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.PumpHistoryRequest;
+import de.jotomo.ruffy.spi.BasalProfile;
+import de.jotomo.ruffy.spi.BolusProgressReporter;
+import de.jotomo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.RuffyCommands;
+import de.jotomo.ruffy.spi.history.PumpHistoryRequest;
+
public class RuffyCommandsV1Impl implements RuffyCommands {
private static RuffyCommands delegate;
- public static RuffyCommands getInstance() {
- if (delegate == null) delegate = new RuffyScripter();
+ public static RuffyCommands getInstance(Context context) {
+ if (delegate == null) delegate = new RuffyScripter(context);
return delegate;
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/RuffyScripter.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java
similarity index 94%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/RuffyScripter.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java
index 523e14c162..9fa725b50d 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/RuffyScripter.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter;
+package de.jotomo.ruffyscripter;
import android.content.ComponentName;
import android.content.Context;
@@ -24,27 +24,24 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
-import info.nightscout.androidaps.MainApp;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.BolusCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.CancelTbrCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.Command;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.CommandException;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.GetPumpStateCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.ReadBasalProfileCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.ReadHistoryCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.ReadReserverLevelCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.SetBasalProfileCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.SetTbrCommand;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BasalProfile;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.Bolus;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.PumpHistory;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.RuffyCommands;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.PumpHistoryRequest;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.Tbr;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.Tdd;
+import de.jotomo.ruffyscripter.commands.BolusCommand;
+import de.jotomo.ruffyscripter.commands.CancelTbrCommand;
+import de.jotomo.ruffyscripter.commands.Command;
+import de.jotomo.ruffyscripter.commands.CommandException;
+import de.jotomo.ruffyscripter.commands.GetPumpStateCommand;
+import de.jotomo.ruffyscripter.commands.ReadBasalProfileCommand;
+import de.jotomo.ruffyscripter.commands.SetBasalProfileCommand;
+import de.jotomo.ruffyscripter.commands.SetTbrCommand;
+import de.jotomo.ruffy.spi.BasalProfile;
+import de.jotomo.ruffy.spi.BolusProgressReporter;
+import de.jotomo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.history.Bolus;
+import de.jotomo.ruffy.spi.history.PumpHistory;
+import de.jotomo.ruffy.spi.PumpState;
+import de.jotomo.ruffy.spi.RuffyCommands;
+import de.jotomo.ruffy.spi.history.PumpHistoryRequest;
+import de.jotomo.ruffy.spi.history.Tbr;
+import de.jotomo.ruffy.spi.history.Tdd;
// TODO regularly read "My data" history (boluses, TBR) to double check all commands ran successfully.
// Automatically compare against AAPS db, or log all requests in the PumpInterface (maybe Milos
@@ -74,8 +71,7 @@ public class RuffyScripter implements RuffyCommands {
private ServiceConnection mRuffyServiceConnection;
- public RuffyScripter() {
- Context context = MainApp.instance().getApplicationContext();
+ public RuffyScripter(Context context) {
boolean boundSucceeded = false;
try {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/BaseCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BaseCommand.java
similarity index 74%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/BaseCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BaseCommand.java
index 3dff8c0a01..4b403f5661 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/BaseCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BaseCommand.java
@@ -1,6 +1,6 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
+import de.jotomo.ruffyscripter.RuffyScripter;
public abstract class BaseCommand implements Command {
// RS will inject itself here
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/BolusCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java
similarity index 96%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/BolusCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java
index 05255fc1e0..7999463af8 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/BolusCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import android.os.SystemClock;
@@ -11,11 +11,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffyscripter.RuffyScripter;
+import de.jotomo.ruffy.spi.BolusProgressReporter;
+import de.jotomo.ruffy.spi.CommandResult;
-import static info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BolusProgressReporter.State.*;
+import static de.jotomo.ruffy.spi.BolusProgressReporter.State.*;
public class BolusCommand extends BaseCommand {
private static final Logger log = LoggerFactory.getLogger(BolusCommand.class);
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/CancelTbrCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CancelTbrCommand.java
similarity index 68%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/CancelTbrCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CancelTbrCommand.java
index 1bb667bf96..d51ef714d8 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/CancelTbrCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CancelTbrCommand.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
import org.slf4j.Logger;
@@ -7,9 +7,8 @@ import org.slf4j.LoggerFactory;
import java.util.Collections;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.PumpState;
-import info.nightscout.androidaps.MainApp;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.PumpState;
+import de.jotomo.ruffy.spi.CommandResult;
// TODO robustness: can a TBR run out, whilst we're trying to cancel it?
// Hm, we could just ignore TBRs that run out within the next 60s (0:01 or even 0:02
@@ -28,14 +27,14 @@ public class CancelTbrCommand extends BaseCommand {
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
PumpState pumpState = scripter.readPumpState();
if (!pumpState.tbrActive) {
- log.debug("active temp basal 90s ago: " +
- MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 90 * 1000));
- log.debug("active temp basal 60s ago: " +
- MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000));
- log.debug("active temp basal 30s ago: " +
- MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000));
- log.debug("active temp basal now:: " +
- MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()));
+// log.debug("active temp basal 90s ago: " +
+// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 90 * 1000));
+// log.debug("active temp basal 60s ago: " +
+// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000));
+// log.debug("active temp basal 30s ago: " +
+// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000));
+// log.debug("active temp basal now:: " +
+// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()));
// TODO keep checking logs to ensure this case only happens because CancelTbrCommand was called
// twice by AAPS
log.warn("No TBR active to cancel");
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/Command.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/Command.java
similarity index 64%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/Command.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/Command.java
index d35f2aafee..e901dbb7e4 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/Command.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/Command.java
@@ -1,9 +1,9 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffyscripter.RuffyScripter;
+import de.jotomo.ruffy.spi.CommandResult;
/**
* Interface for all commands to be executed by the pump.
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/CommandException.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CommandException.java
similarity index 88%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/CommandException.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CommandException.java
index db9f57dd9a..a6a1d06d8a 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/CommandException.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CommandException.java
@@ -1,6 +1,6 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.CommandResult;
public class CommandException extends RuntimeException {
public boolean success = false;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/GetBasalRateProfileCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/GetBasalRateProfileCommand.java
similarity index 94%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/GetBasalRateProfileCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/GetBasalRateProfileCommand.java
index c8719ab1f2..c77e4913f6 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/GetBasalRateProfileCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/GetBasalRateProfileCommand.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import android.util.Log;
@@ -10,8 +10,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffyscripter.RuffyScripter;
+import de.jotomo.ruffy.spi.CommandResult;
public class GetBasalRateProfileCommand extends BaseCommand {
private static final Logger log = LoggerFactory.getLogger(GetBasalRateProfileCommand.class);
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/GetPumpStateCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/GetPumpStateCommand.java
similarity index 94%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/GetPumpStateCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/GetPumpStateCommand.java
index 392825a3bb..9c89932413 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/GetPumpStateCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/GetPumpStateCommand.java
@@ -1,13 +1,13 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
import java.util.Collections;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.CommandResult;
-import static info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands.GetPumpStateCommand.Stepper.runStep;
+import static de.jotomo.ruffyscripter.commands.GetPumpStateCommand.Stepper.runStep;
public class GetPumpStateCommand extends BaseCommand {
interface Step {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadBasalProfileCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadBasalProfileCommand.java
similarity index 63%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadBasalProfileCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadBasalProfileCommand.java
index f5b925d971..c3e305ff91 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadBasalProfileCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadBasalProfileCommand.java
@@ -1,9 +1,9 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffyscripter.RuffyScripter;
+import de.jotomo.ruffy.spi.CommandResult;
public class ReadBasalProfileCommand implements Command {
private final int number;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadHistoryCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadHistoryCommand.java
similarity index 53%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadHistoryCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadHistoryCommand.java
index 06e94a9d67..5885f10b14 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadHistoryCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadHistoryCommand.java
@@ -1,10 +1,10 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.history.PumpHistory;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.history.PumpHistory;
+import de.jotomo.ruffyscripter.RuffyScripter;
+import de.jotomo.ruffy.spi.CommandResult;
public class ReadHistoryCommand implements Command {
public ReadHistoryCommand(PumpHistory knownHistory) {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadReserverLevelCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadReserverLevelCommand.java
similarity index 56%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadReserverLevelCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadReserverLevelCommand.java
index 5d0fcf04c6..34fac4a305 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/ReadReserverLevelCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/ReadReserverLevelCommand.java
@@ -1,9 +1,9 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffyscripter.RuffyScripter;
+import de.jotomo.ruffy.spi.CommandResult;
public class ReadReserverLevelCommand implements Command {
@Override
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetBasalProfileCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java
similarity index 54%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetBasalProfileCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java
index 438a1f91c5..37c52def39 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetBasalProfileCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java
@@ -1,10 +1,10 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.BasalProfile;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.RuffyScripter;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.BasalProfile;
+import de.jotomo.ruffyscripter.RuffyScripter;
+import de.jotomo.ruffy.spi.CommandResult;
public class SetBasalProfileCommand implements Command {
public SetBasalProfileCommand(BasalProfile basalProfile) {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetBasalRateProfileCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalRateProfileCommand.java
similarity index 64%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetBasalRateProfileCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalRateProfileCommand.java
index 87c530015e..6cace333c7 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetBasalRateProfileCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalRateProfileCommand.java
@@ -1,8 +1,8 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import java.util.List;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.CommandResult;
public class SetBasalRateProfileCommand extends BaseCommand {
@Override
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetTbrCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java
similarity index 98%
rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetTbrCommand.java
rename to ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java
index e3e6398700..89273bcdb3 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffy/internal/scripter/commands/SetTbrCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.PumpCombo.ruffy.internal.scripter.commands;
+package de.jotomo.ruffyscripter.commands;
import android.os.SystemClock;
@@ -12,7 +12,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
-import info.nightscout.androidaps.plugins.PumpCombo.ruffy.spi.CommandResult;
+import de.jotomo.ruffy.spi.CommandResult;
public class SetTbrCommand extends BaseCommand {
private static final Logger log = LoggerFactory.getLogger(SetTbrCommand.class);
diff --git a/app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/Menu.java b/ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/Menu.java
similarity index 100%
rename from app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/Menu.java
rename to ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/Menu.java
diff --git a/app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuAttribute.java b/ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuAttribute.java
similarity index 100%
rename from app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuAttribute.java
rename to ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuAttribute.java
diff --git a/app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuType.java b/ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuType.java
similarity index 100%
rename from app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuType.java
rename to ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/MenuType.java
diff --git a/app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/BolusType.java b/ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/BolusType.java
similarity index 100%
rename from app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/BolusType.java
rename to ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/BolusType.java
diff --git a/app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuBlink.java b/ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuBlink.java
similarity index 100%
rename from app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuBlink.java
rename to ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuBlink.java
diff --git a/app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuDate.java b/ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuDate.java
similarity index 100%
rename from app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuDate.java
rename to ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuDate.java
diff --git a/app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuTime.java b/ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuTime.java
similarity index 100%
rename from app/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuTime.java
rename to ruffyscripter/src/main/java/org/monkey/d/ruffy/ruffy/driver/display/menu/MenuTime.java
diff --git a/settings.gradle b/settings.gradle
index 9ccfb61915..a55c0c137c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':app', ':wear'
+include ':app', ':wear', ':ruffyscripter', ':ruffy-spi'