diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 69a2e77c5..0cbbc868f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -381,14 +381,14 @@ + android:exported="true"> + android:exported="true"> diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/GenericWeatherReceiver.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/GenericWeatherReceiver.java index f1899bbc5..28969d027 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/GenericWeatherReceiver.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/GenericWeatherReceiver.java @@ -25,6 +25,8 @@ import android.widget.Toast; import org.json.JSONArray; import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; @@ -34,6 +36,8 @@ import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec; import nodomain.freeyourgadget.gadgetbridge.util.GB; public class GenericWeatherReceiver extends BroadcastReceiver { + private static final Logger LOG = LoggerFactory.getLogger(GenericWeatherReceiver.class); + public final static String ACTION_GENERIC_WEATHER = "nodomain.freeyourgadget.gadgetbridge.ACTION_GENERIC_WEATHER"; public final static String EXTRA_WEATHER_JSON = "WeatherJson"; @@ -68,7 +72,7 @@ public class GenericWeatherReceiver extends BroadcastReceiver { JSONObject forecastJson = forecastArray.getJSONObject(i); WeatherSpec.Forecast forecast = new WeatherSpec.Forecast(); - + forecast.conditionCode = safelyGet(forecastJson, Integer.class, "conditionCode", 0); forecast.humidity = safelyGet(forecastJson, Integer.class, "humidity", 0); forecast.maxTemp = safelyGet(forecastJson, Integer.class, "maxTemp", 0); @@ -78,6 +82,8 @@ public class GenericWeatherReceiver extends BroadcastReceiver { } } + LOG.info("Got generic weather for {}", weatherSpec.location); + Weather.getInstance().setWeatherSpec(weatherSpec); GBApplication.deviceService().onSendWeather(weatherSpec); } catch (Exception e) {