diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Weather.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Weather.java index 3d8ab419e..a27c4a9a0 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Weather.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Weather.java @@ -202,6 +202,11 @@ public class Huami2021Weather { weather.add(new Range(currentWeatherCode, currentWeatherCode)); if (weatherSpec.sunRise != 0 && weatherSpec.sunSet != 0) { sunRiseSet.add(getSunriseSunset(new Date(weatherSpec.sunRise * 1000L), new Date(weatherSpec.sunSet * 1000L))); + } else if (weatherSpec.latitude != 0 && weatherSpec.longitude != 0) { + final Location weatherSpecLocation = new Location("weatherSpec"); + weatherSpecLocation.setLatitude(weatherSpec.latitude); + weatherSpecLocation.setLatitude(weatherSpec.longitude); + sunRiseSet.add(getSunriseSunset(sunriseDate, weatherSpecLocation)); } else { sunRiseSet.add(getSunriseSunset(sunriseDate, lastKnownLocation)); }