From b7a1f469ee60c789d9d46511e6e440685465b816 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Mon, 29 Jun 2020 19:02:30 +0200 Subject: [PATCH] Huami: limit forecast days to 3 days Fixes problems with new weather notificaion on Mi Band 4 and others Fixes #1910 --- .../gadgetbridge/service/devices/huami/HuamiSupport.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java index c1727800a..92b2a17ed 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java @@ -1965,7 +1965,9 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport { try { TransactionBuilder builder = performInitialized("Sending weather forecast"); - + if (weatherSpec.forecasts.size() > 3) { //TDOD: find out the limits for each device + weatherSpec.forecasts.subList(3, weatherSpec.forecasts.size()).clear(); + } final byte NR_DAYS = (byte) (1 + weatherSpec.forecasts.size()); int bytesPerDay = 4;