Skip to content

Commit 1d70112

Browse files
authored
Add files via upload
1 parent bde5c53 commit 1d70112

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

Chimaera.pbw

2.36 KB
Binary file not shown.

src/c/main.c

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ static FFont* FontSelect(FFont* FontTime1, FFont* FontTime2, FFont* FontTime3){
137137
}
138138
#endif*/
139139
// Callback for js request
140-
/*void request_watchjs(){
140+
void request_watchjs(){
141141
//Starting loop at 0
142-
s_loop = 0;
142+
//s_loop = 0;
143143
// Begin dictionary
144144
DictionaryIterator * iter;
145145
app_message_outbox_begin( & iter);
146146
// Add a key-value pair
147147
dict_write_uint8(iter, 0, 0);
148148
// Send the message!
149149
app_message_outbox_send();
150-
}*/
150+
}
151151

152152
/*static void accel_tap_handler(AccelAxisType axis, int32_t direction) {
153153
// A tap event occured
@@ -177,12 +177,12 @@ static void quiet_time_icon () {
177177
}
178178
}
179179

180-
/*static void onreconnection(bool before, bool now){
180+
static void onreconnection(bool before, bool now){
181181
if (!before && now){
182-
APP_LOG(APP_LOG_LEVEL_DEBUG, "BT reconnected, requesting weather at %d:%d", s_hours,s_minutes);
182+
APP_LOG(APP_LOG_LEVEL_DEBUG, "BT reconnected, requesting watchjs at %d:%d", s_hours,s_minutes);
183183
request_watchjs();
184184
}
185-
}*/
185+
}
186186

187187

188188
//Add in HEALTH to the watchface
@@ -612,7 +612,7 @@ static void layer_update_proc_bt(Layer * layer3, GContext * ctx3){
612612
GRect(180-20-30,140,16,20),
613613
GRect(144-19,140,18,20)));
614614

615-
//onreconnection(BTOn, connection_service_peek_pebble_app_connection());
615+
onreconnection(BTOn, connection_service_peek_pebble_app_connection());
616616
bluetooth_callback(connection_service_peek_pebble_app_connection());
617617

618618
graphics_context_set_text_color(ctx3, ColorSelect(settings.Text5Color, settings.Text5ColorN));
@@ -917,11 +917,13 @@ settings.Text10Color = GColorFromHEX(tx10_color_t-> value -> int32);
917917
//Hour Sunrise and Sunset
918918
Tuple * sunrise_t = dict_find(iter, MESSAGE_KEY_HourSunrise);
919919
if (sunrise_t){
920-
HourSunrise = (int) sunrise_t -> value -> int32;
920+
HourSunrise = sunrise_t -> value -> int32;
921+
APP_LOG(APP_LOG_LEVEL_DEBUG, "HourSunrise is %d", HourSunrise);
921922
}
922923
Tuple * sunset_t = dict_find(iter, MESSAGE_KEY_HourSunset);
923924
if (sunset_t){
924-
HourSunset = (int) sunset_t -> value -> int32;
925+
HourSunset = sunset_t -> value -> int32;
926+
APP_LOG(APP_LOG_LEVEL_DEBUG, "HourSunset is %d", HourSunrise);
925927
}
926928

927929
Tuple * disntheme_t = dict_find(iter, MESSAGE_KEY_NightTheme);
@@ -1127,9 +1129,15 @@ static void tick_handler(struct tm * time_now, TimeUnits changed){
11271129
int nowthehouris = s_hours * 100 + s_minutes;
11281130
if (HourSunrise <= nowthehouris && nowthehouris <= HourSunset){
11291131
IsNightNow = false;
1130-
} else{
1132+
APP_LOG(APP_LOG_LEVEL_DEBUG, "isnightnow is false");
1133+
} else{
11311134
IsNightNow = true;
1135+
APP_LOG(APP_LOG_LEVEL_DEBUG, "isnightnow is true");
11321136
}
1137+
APP_LOG(APP_LOG_LEVEL_DEBUG, "Hoursunrise is %d", HourSunrise);
1138+
APP_LOG(APP_LOG_LEVEL_DEBUG, "Hoursunset is %d", HourSunset);
1139+
APP_LOG(APP_LOG_LEVEL_DEBUG, "nowthehouris is %d", nowthehouris);
1140+
11331141
// Extra catch on sunrise and sunset
11341142
/* if (nowthehouris == HourSunrise || nowthehouris == HourSunset){
11351143
s_countdown = 1;
@@ -1171,7 +1179,7 @@ static void init(){
11711179
// Listen for AppMessages
11721180
//Starting loop at 0
11731181
// s_loop = 0;
1174-
//s_countdown = settings.UpSlider;
1182+
// s_countdown = settings.UpSlider;
11751183
//Clean vars
11761184

11771185
// strcpy(settings.windiconnowstring, "\U0000F04B");

src/pkjs/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,10 @@ function suncalcinfo (pos){
285285
var sunsetStr = String(sunsetStrhr + ":" + sunsetStrmin);
286286
var sunriseStrhr = ('0'+sunTimes.sunrise.getHours()).substr(-2);
287287
var sunriseStrmin = ('0'+sunTimes.sunrise.getMinutes()).substr(-2);
288-
var sunsetint= (sunsetStrhr*1) + sunsetStrmin;
289-
var sunriseint= (sunriseStrhr*1) + sunriseStrmin;
288+
var sunriseint = sunTimes.sunrise.getHours()*100+sunTimes.sunrise.getMinutes();
289+
var sunsetint = sunTimes.sunset.getHours()*100+sunTimes.sunset.getMinutes();
290+
//var sunsetint= String((sunsetStrhr*1) + sunsetStrmin);
291+
//var sunriseint= String((sunriseStrhr*1) + sunriseStrmin);
290292
var sunriseStr = String(sunriseStrhr + ":" + sunriseStrmin);
291293
var sunsetStrhr12 = parseInt(sunTimes.sunset.getHours());
292294
var sunriseStrhr12 = parseInt(sunTimes.sunrise.getHours());

0 commit comments

Comments
 (0)