more bug fixing

moved rate limiting to another class
navigation header is close to being functional
This commit is contained in:
Giovanni Harting
2015-10-31 22:30:25 +01:00
parent ce198af0ef
commit 2211186d9f
12 changed files with 202 additions and 78 deletions

View File

@@ -231,10 +231,16 @@ public class LedDHelper {
try {
JSONObject json = new JSONObject(response.getResult().toString());
JSONArray hsv = json.getJSONArray("color");
ledStripe.setColor(new HSV(hsv.getDouble(0), hsv.getDouble(1), hsv.getDouble(2)));
callback.onColorRecieved(ledStripe);
if (hsv.length() == 3) {
System.out.println(hsv);
ledStripe.setColor(new HSV(hsv.getDouble(0), hsv.getDouble(1), hsv.getDouble(2)));
callback.onColorRecieved(ledStripe);
} else {
callback.onRecievFailed(-1, "HSV was empty");
}
} catch (JSONException e) {
e.printStackTrace();
callback.onRecievFailed(-1, "Unhandeled JSON Exception");
}
} else {
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") JSONRPC2Error error = response.getError();