From ee14b5d821563ccd77bbe53c8f0e1c5fb3dac1e2 Mon Sep 17 00:00:00 2001 From: "Martin.JM" Date: Sun, 4 Feb 2024 01:19:15 +0100 Subject: [PATCH] Small changes --- .../devices/huawei/requests/SendWeatherForecastRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/SendWeatherForecastRequest.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/SendWeatherForecastRequest.java index 90fc46a27..5871fa768 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/SendWeatherForecastRequest.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/SendWeatherForecastRequest.java @@ -45,7 +45,7 @@ public class SendWeatherForecastRequest extends Request { this.weatherSpec.forecasts.size() // TODO: wrong size ); // for (WeatherSpec.Hourly hourly : weatherSpec.hourly) { - for (int i = Math.min(weatherSpec.hourly.size(), 24) - 1; i >= 0; i--) { // TODO: min? + for (int i = 0; i < Math.min(weatherSpec.hourly.size(), 24); i++) { // TODO: min? WeatherSpec.Hourly hourly = weatherSpec.hourly.get(i); WeatherForecastData.TimeData timeData = new WeatherForecastData.TimeData(); timeData.timestamp = hourly.timestamp; @@ -70,7 +70,7 @@ public class SendWeatherForecastRequest extends Request { for (int i = 0; i < Math.min(weatherSpec.forecasts.size(), 7); i++) { // TODO: min? WeatherSpec.Daily daily = weatherSpec.forecasts.get(i); WeatherForecastData.DayData dayData = new WeatherForecastData.DayData(); - dayData.timestamp = daily.sunRise; + dayData.timestamp = weatherSpec.timestamp + (60*60*24 * i); dayData.icon = supportProvider.openWeatherMapConditionCodeToHuaweiIcon(daily.conditionCode); dayData.highTemperature = (byte) (daily.maxTemp - 273); dayData.lowTemperature = (byte) (daily.minTemp - 273);