diff --git a/src/app/weather/images/resolve_owm_icon.cpp b/src/app/weather/images/resolve_owm_icon.cpp index 6094250..c188941 100644 --- a/src/app/weather/images/resolve_owm_icon.cpp +++ b/src/app/weather/images/resolve_owm_icon.cpp @@ -70,6 +70,6 @@ const void * resolve_owm_icon( char *iconname ) { return( owm_icon[ icon ].icon ); } } - return( NULL ); + return( &owm_01d_64px ); } diff --git a/src/app/weather/weather_fetch.cpp b/src/app/weather/weather_fetch.cpp index 301b3e2..8b73128 100644 --- a/src/app/weather/weather_fetch.cpp +++ b/src/app/weather/weather_fetch.cpp @@ -113,15 +113,15 @@ int weather_fetch_forecast( weather_config_t *weather_config, weather_forcast_t weather_forecast[0].valide = true; for ( int i = 0 ; i < WEATHER_MAX_FORECAST ; i++ ) { - weather_forecast[ i ].timestamp = doc["list"][i]["dt"].as(); + weather_forecast[ i ].timestamp = doc["list"][i]["dt"].as() | 0; snprintf( weather_forecast[ i ].temp, sizeof( weather_forecast[ i ].temp ),"%0.1f°%s", doc["list"][i]["main"]["temp"].as(), weather_units_symbol ); snprintf( weather_forecast[ i ].humidity, sizeof( weather_forecast[ i ].humidity ),"%f%%", doc["list"][i]["main"]["humidity"].as() ); snprintf( weather_forecast[ i ].pressure, sizeof( weather_forecast[ i ].pressure ),"%fpha", doc["list"][i]["main"]["pressure"].as() ); - strlcpy( weather_forecast[ i ].icon, doc["list"][i]["weather"][0]["icon"], sizeof( weather_forecast[ i ].icon ) ); - strlcpy( weather_forecast[ i ].name, doc["city"]["name"], sizeof( weather_forecast[ i ].name ) ); + strlcpy( weather_forecast[ i ].icon, doc["list"][i]["weather"][0]["icon"] | "n/a", sizeof( weather_forecast[ i ].icon ) ); + strlcpy( weather_forecast[ i ].name, doc["city"]["name"] | "n/a", sizeof( weather_forecast[ i ].name ) ); - int directionDegree = doc["list"][i]["wind"]["deg"].as(); - int speed = doc["list"][i]["wind"]["speed"].as(); + int directionDegree = doc["list"][i]["wind"]["deg"].as() | 0; + int speed = doc["list"][i]["wind"]["speed"].as() | 0; weather_wind_to_string( &weather_forecast[i], speed, directionDegree ); } diff --git a/src/app/weather/weather_setup.cpp b/src/app/weather/weather_setup.cpp index 8795e90..06198e1 100644 --- a/src/app/weather/weather_setup.cpp +++ b/src/app/weather/weather_setup.cpp @@ -280,9 +280,9 @@ void bluetooth_message_msg_pharse( char* msg ) { if ( !strcmp( doc["app"], "weather" ) ) { weather_config_t *weather_config = weather_get_config(); - strlcpy( weather_config->apikey, doc["apikey"], sizeof( weather_config->apikey ) ); - strlcpy( weather_config->lat, doc["lat"], sizeof( weather_config->lat ) ); - strlcpy( weather_config->lon, doc["lon"], sizeof( weather_config->lon ) ); + strlcpy( weather_config->apikey, doc["apikey"] |"", sizeof( weather_config->apikey ) ); + strlcpy( weather_config->lat, doc["lat"] | "", sizeof( weather_config->lat ) ); + strlcpy( weather_config->lon, doc["lon"] | "", sizeof( weather_config->lon ) ); weather_save_config(); motor_vibe(100); } diff --git a/src/config.h b/src/config.h index 3cd3b7d..5e1c7d5 100644 --- a/src/config.h +++ b/src/config.h @@ -32,6 +32,6 @@ /* * firmeware version string */ - #define __FIRMWARE__ "2020082106" + #define __FIRMWARE__ "2020082107" #endif // _CONFIG_H diff --git a/ttgo-t-watch2020_v1.ino.bin b/ttgo-t-watch2020_v1.ino.bin index a7b88f0..d3d8e1f 100644 Binary files a/ttgo-t-watch2020_v1.ino.bin and b/ttgo-t-watch2020_v1.ino.bin differ diff --git a/ttgo-t-watch2020_v1.version.json b/ttgo-t-watch2020_v1.version.json index a1ec42b..0d5adb5 100644 --- a/ttgo-t-watch2020_v1.version.json +++ b/ttgo-t-watch2020_v1.version.json @@ -1 +1 @@ -{"version":"2020082106","host":"http://www.neo-guerillaz.de","file":"ttgo-t-watch2020_v1.ino.bin"} +{"version":"2020082107","host":"http://www.neo-guerillaz.de","file":"ttgo-t-watch2020_v1.ino.bin"}