1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-19 00:19:25 +01:00

Fix Weather notification integration

This commit is contained in:
José Rebelo 2023-07-07 09:03:35 +01:00 committed by Andreas Shimokawa
parent 0f7fa75931
commit feff249b24
2 changed files with 9 additions and 3 deletions

View File

@ -381,14 +381,14 @@
<receiver
android:name=".externalevents.WeatherNotificationReceiver"
android:enabled="true"
android:exported="false">
android:exported="true">
<intent-filter>
<action android:name="ru.gelin.android.weather.notification.ACTION_WEATHER_UPDATE_2" />
</intent-filter>
</receiver>
<activity android:name=".externalevents.WeatherNotificationConfig"
android:exported="false">
android:exported="true">
<intent-filter>
<action android:name="ru.gelin.android.weather.notification.ACTION_WEATHER_SKIN_PREFERENCES" />
</intent-filter>

View File

@ -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";
@ -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) {