Update to v1.0.2
Change timeout to 30 seconds Add version info to settings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
argv = ['/Users/dan/pebble-dev/PebbleSDK-2.0.2/Pebble/waf', 'configure', 'build']
|
||||
environ = {'TERM_SESSION_ID': '0E771BB8-6D47-41B3-A896-1B67A6BC492D', 'SSH_AUTH_SOCK': '/tmp/launch-mBweRR/Listeners', 'PYTHONPATH': '/Users/dan/pebble-dev/PebbleSDK-current/bin/../.env/lib/python2.7/site-packages', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'TERM_PROGRAM_VERSION': '326', 'SHELL': '/bin/bash', 'LOGNAME': 'dan', 'USER': 'dan', 'HOME': '/Users/dan', 'PATH': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/arm-cs-tools/bin:/Users/dan/pebble-dev/PebbleSDK-current/bin:/Applications/Android Studio.app/sdk/tools/:/Applications/Android Studio.app/sdk/platform-tools/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin', 'DISPLAY': '/tmp/launch-FHtlTI/org.macosforge.xquartz:0', 'TMPDIR': '/var/folders/5l/h8wjt5t52cs2n6h7zcd3kw040000gn/T/', 'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'en_GB.UTF-8', 'TERM': 'xterm-256color', 'Apple_PubSub_Socket_Render': '/tmp/launch-BrNYWU/Render', 'VERSIONER_PYTHON_VERSION': '2.7', 'SHLVL': '2', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'PWD': '/Users/dan/Workspace/minewatch/app', '_': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/Pebble/waf', '__CHECKFIX1436934': '1', 'PEBBLE_PHONE': '192.168.1.147'}
|
||||
environ = {'TERM_SESSION_ID': '3CD8238C-58C7-4290-8ACF-B40F29CAA6DF', 'SSH_AUTH_SOCK': '/tmp/launch-6iGfhV/Listeners', 'PYTHONPATH': '/Users/dan/pebble-dev/PebbleSDK-current/bin/../.env/lib/python2.7/site-packages', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'TERM_PROGRAM_VERSION': '326', 'SHELL': '/bin/bash', 'LOGNAME': 'dan', 'USER': 'dan', 'HOME': '/Users/dan', 'PATH': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/arm-cs-tools/bin:/Users/dan/pebble-dev/PebbleSDK-current/bin:/Applications/Android Studio.app/sdk/tools/:/Applications/Android Studio.app/sdk/platform-tools/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin', 'DISPLAY': '/tmp/launch-oMwao1/org.macosforge.xquartz:0', 'TMPDIR': '/var/folders/5l/h8wjt5t52cs2n6h7zcd3kw040000gn/T/', 'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'en_GB.UTF-8', 'TERM': 'xterm-256color', 'Apple_PubSub_Socket_Render': '/tmp/launch-YAZ4GK/Render', 'VERSIONER_PYTHON_VERSION': '2.7', 'SHLVL': '2', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'PWD': '/Users/dan/Workspace/minewatch/app', '_': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/Pebble/waf', 'JAVA_HOME': '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home', '__CHECKFIX1436934': '1', 'PEBBLE_PHONE': '192.168.1.147'}
|
||||
files = ['/Users/dan/Workspace/minewatch/app/wscript']
|
||||
hash = 4672844372416070989
|
||||
options = {'files': '', 'jobs': 4, 'verbose': 0, 'nocache': False, 'progress_bar': 0, 'timestamp': None, 'distcheck_args': None, 'top': '', 'destdir': '', 'keep': 0, 'zones': '', 'debug': False, 'prefix': '/usr/local/', 'download': False, 'force': False, 'targets': '', 'out': ''}
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
"shortName": "MineWatch",
|
||||
"longName": "MineWatch",
|
||||
"companyName": "Daniel Head",
|
||||
"versionCode": 2,
|
||||
"versionLabel": "1.0.1",
|
||||
"versionCode": 3,
|
||||
"versionLabel": "1.0.2",
|
||||
"watchapp": {
|
||||
"watchface": true
|
||||
},
|
||||
"capabilities": [ "configurable" ],
|
||||
"appKeys": {
|
||||
"version":0,
|
||||
"response":1,
|
||||
"update":2,
|
||||
"dark":3,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
var config = {
|
||||
"jsversion":"1.0.2",
|
||||
"pblversion":(localStorage.getItem("pblversion") || ""),
|
||||
"dark":((localStorage.getItem("dark") == "true")?true:false),
|
||||
"notify":((localStorage.getItem("notify") == "true")?true:false),
|
||||
"flick":((localStorage.getItem("flick") == "true")?true:false),
|
||||
@@ -35,13 +37,7 @@ var sendResponseWithUpdate = function(obj) {
|
||||
return;
|
||||
}
|
||||
var req = new XMLHttpRequest();
|
||||
req.timeout = 30000;
|
||||
req.ontimeout = function() {
|
||||
if(!obj) obj = {};
|
||||
obj["response"] = "TIMEOUT";
|
||||
Pebble.sendAppMessage(obj);
|
||||
}
|
||||
req.onload = function(e) {
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState == 4) {
|
||||
if(req.status == 200) {
|
||||
var response = JSON.parse(req.responseText);
|
||||
@@ -78,13 +74,15 @@ var sendResponseWithUpdate = function(obj) {
|
||||
obj["response"] = "InvAPI";
|
||||
Pebble.sendAppMessage(obj);
|
||||
}
|
||||
} else {
|
||||
if(!obj) obj = {};
|
||||
obj["response"] = "TIMEOUT";
|
||||
Pebble.sendAppMessage(obj);
|
||||
}
|
||||
}
|
||||
req.open('GET', "https://mining.bitcoin.cz/accounts/profile/json/" + config.apikey, true);
|
||||
req.timeout = 30000;
|
||||
req.ontimeout = function() {
|
||||
if(!obj) obj = {};
|
||||
obj["response"] = "TIMEOUT";
|
||||
Pebble.sendAppMessage(obj);
|
||||
}
|
||||
req.send(null);
|
||||
}
|
||||
var getSettings = function() {
|
||||
@@ -101,6 +99,10 @@ Pebble.addEventListener("ready", function(e) {
|
||||
});
|
||||
|
||||
Pebble.addEventListener("appmessage", function(e) {
|
||||
if(e.payload.version) {
|
||||
config.pblversion = e.payload.version;
|
||||
localStorage.setItem("pblversion",e.payload.version);
|
||||
}
|
||||
sendResponseWithUpdate();
|
||||
});
|
||||
Pebble.addEventListener("showConfiguration", function(e) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
static Window *window;
|
||||
static GFont font_xs, font_s, font_m, font_l;
|
||||
static InverterLayer *inverter_layer;
|
||||
static char *version_number = "1.0.2";
|
||||
|
||||
//TIME/DATE
|
||||
static TextLayer *time_layer;
|
||||
@@ -13,7 +14,7 @@ static char date_text[] = "00 Xxxxxxxxx";
|
||||
|
||||
//REFRESH ICON
|
||||
static AppTimer *timeout_timer;
|
||||
static int timeout_length = 15000; //ms
|
||||
//static int timeout_length = 65000; //ms
|
||||
static BitmapLayer *refresh_layer;
|
||||
static GBitmap *refresh_icon;
|
||||
|
||||
@@ -59,6 +60,7 @@ static int progress_width = 0;
|
||||
|
||||
//KEYS
|
||||
enum {
|
||||
VERSION = 0x0,
|
||||
RESPONSE = 0x1,
|
||||
UPDATE = 0x2,
|
||||
DARK = 0x3,
|
||||
@@ -100,8 +102,8 @@ static void fetch_msg(void) {
|
||||
//Make sure we don't request more than once per min (be nice to Mr Slush)
|
||||
if(current_min == last_update_min) return;
|
||||
last_update_min = current_min;
|
||||
Tuplet fetch_tuple = TupletInteger(0x0, 1);
|
||||
timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
|
||||
|
||||
//timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
|
||||
show_refresh(true);
|
||||
DictionaryIterator *iter;
|
||||
app_message_outbox_begin(&iter);
|
||||
@@ -109,11 +111,11 @@ static void fetch_msg(void) {
|
||||
if (iter == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
dict_write_tuplet(iter, &fetch_tuple);
|
||||
dict_write_cstring(iter, VERSION, version_number);
|
||||
dict_write_end(iter);
|
||||
|
||||
app_message_outbox_send();
|
||||
uint32_t appMsgResp = app_message_outbox_send();
|
||||
if(appMsgResp != APP_MSG_OK) show_refresh(false);
|
||||
}
|
||||
|
||||
static void handle_flick(AccelAxisType axis, int32_t direction) {
|
||||
@@ -258,7 +260,7 @@ static void in_received_handler(DictionaryIterator *iter, void *context) {
|
||||
layer_set_hidden(btc_parent_layer,false);
|
||||
strcpy(last_update_text,time_text);
|
||||
}
|
||||
app_timer_cancel(timeout_timer);
|
||||
//app_timer_cancel(timeout_timer);
|
||||
if(strcmp(response_tuple->value->cstring,"TIMEOUT")!=0) layer_set_hidden(bitmap_layer_get_layer(refresh_layer),true);
|
||||
}
|
||||
}
|
||||
@@ -483,7 +485,7 @@ static void init(void) {
|
||||
bluetooth_connection_service_subscribe(handle_bluetooth);
|
||||
tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick);
|
||||
if(flick) enable_flick(true);
|
||||
timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
|
||||
//timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
|
||||
}
|
||||
|
||||
static void deinit(void) {
|
||||
|
||||
Reference in New Issue
Block a user