Skip to content

Commit

Permalink
Battery saving changes, also finally got a sane IDE (go go jetbrains …
Browse files Browse the repository at this point in the history
…CLion!) so many small syntax changes.
  • Loading branch information
jaredbiehler committed Nov 12, 2014
1 parent dff4808 commit fd996dc
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
build/
.lock-waf_darwin_build
psd/
CMakeLists.txt
src/CMakeLists.txt
.idea/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Weather My Way (Pebble SDK 2.0)

This is my attempt at learning about the Pebble SDK by adjusting an app for my own needs. The original Futura Weather watchface was the cleanest and best looking design I had seen but I prefer YAHOO! Weather data. So, I added the option to switch between both, and added hourly data from Weather Underground.

Give it a shot and let me know what you think: [download pbw here](https://github.com/jaredbiehler/weather-my-way/releases/download/1.1.1/weather-my-way-v1.1.1.pbw)
Give it a shot and let me know what you think: [download pbw here](https://github.com/jaredbiehler/weather-my-way/releases/)

![pebble screen1](https://raw.githubusercontent.com/jaredbiehler/weather-my-way/master/screenshots/pebble-screenshot1.png) 
![pebble screen2](https://raw.githubusercontent.com/jaredbiehler/weather-my-way/master/screenshots/pebble-screenshot2.png) 
Expand Down
4 changes: 2 additions & 2 deletions appinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"shortName": "Weather My Way",
"longName": "Weather My Way",
"companyName": "Jared Biehler",
"versionCode": 6,
"versionLabel": "1.1.1",
"versionCode": 7,
"versionLabel": "1.2",
"capabilities": [ "configurable", "location" ],
"watchapp": {
"watchface": true
Expand Down
2 changes: 1 addition & 1 deletion src/battery_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ void battery_layer_create(GRect frame, Window *window);
void battery_enable_display();
void battery_disable_display();
void battery_timer_callback();
void battery_layer_update();
void battery_layer_update(Layer *me, GContext *ctx);
void battery_layer_destroy();

#endif
1 change: 0 additions & 1 deletion src/datetime_layer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <pebble.h>
#include "network.h"
#include "datetime_layer.h"

static TextLayer *time_layer;
Expand Down
2 changes: 1 addition & 1 deletion src/datetime_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

void date_layer_create(GRect frame, Window *window);
void time_layer_create(GRect frame, Window *window);
void date_layer_update();
void date_layer_update(struct tm *tick_time);
void time_layer_update();
void date_layer_destroy();
void time_layer_destroy();
Expand Down
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ static void handle_tick(struct tm *tick_time, TimeUnits units_changed)
weather_layer_update(weather_data);
*/

// Refresh the weather info every 15 mins, targeting 18 mins after the hour (Yahoo updates around then)
// Refresh the weather info every 30 mins, targeting 18 mins after the hour (Yahoo updates around then)
if ((units_changed & MINUTE_UNIT) &&
(tick_time->tm_min % 15 == 3) &&
(tick_time->tm_min % 30 == 18) &&
!initial_request) {
request_weather(weather_data);
}
Expand Down Expand Up @@ -109,7 +109,7 @@ static void init(void)
handle_tick(localtime(&now), MINUTE_UNIT | DAY_UNIT );

// And then every minute
tick_timer_service_subscribe(SECOND_UNIT, handle_tick);
tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);
}

static void deinit(void)
Expand Down
2 changes: 1 addition & 1 deletion src/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void appmsg_in_received(DictionaryIterator *received, void *context) {

weather_layer_update(weather);

// Succes! reset the retry count...
// Success! reset the retry count...
retry_count = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ typedef struct {

void init_network(WeatherData *weather_data);
void close_network();
void request_weather();
void request_weather(WeatherData *weather_data);
7 changes: 2 additions & 5 deletions src/weather_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void weather_layer_clear_temperature()
text_layer_set_text(wld->primary_temp_layer, "");
}

void weather_layer_set_temperature(int16_t t, bool is_stale)
void weather_layer_set_temperature(int16_t t, bool is_stale)
{
WeatherLayerData *wld = layer_get_data(weather_layer);

Expand Down Expand Up @@ -506,7 +506,7 @@ uint8_t yahoo_weather_icon_for_condition(int c, bool night_time)
return W_ICON_SNOW_SLEET;
}
// Drizzle // Showers
else if (c == 9 || c == 11 || c == 40) {
else if (c == 9 || c == 11) {
return W_ICON_DRIZZLE;
}
// Rain / Scattered Showers / Thundershowers
Expand Down Expand Up @@ -584,9 +584,6 @@ uint8_t yahoo_weather_icon_for_condition(int c, bool night_time)
return W_ICON_RAIN_SUN;
}
// Weather condition not available
else if (c == 3200) {
return W_ICON_NOT_AVAILABLE;
}
else {
return W_ICON_NOT_AVAILABLE;
}
Expand Down
2 changes: 1 addition & 1 deletion src/weather_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void weather_layer_create(GRect frame, Window *window);
void weather_animate(void *context);
void weather_layer_update(WeatherData *weather_data);
void weather_layer_destroy();
void weather_layer_set_temperature(int16_t temperature, bool is_stale);
void weather_layer_set_temperature(int16_t t, bool is_stale);
void weather_layer_clear_temperature();
uint8_t open_weather_icon_for_condition(int condition, bool night_time);
uint8_t yahoo_weather_icon_for_condition(int condition, bool night_time);
Expand Down

0 comments on commit fd996dc

Please sign in to comment.