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

Huawei: Fix for weather

If there is no moon rise/setting on a day, it should not be zero. It
should not be set at all. Some bands/watches don't care, but some might.
This commit is contained in:
Martin.JM 2024-07-26 20:39:12 +02:00
parent 0188820048
commit 82d12e5fbe

View File

@ -632,9 +632,9 @@ public class Weather {
dayTlv.put(0x16, dayData.sunriseTime); dayTlv.put(0x16, dayData.sunriseTime);
if (dayData.sunsetTime != null) if (dayData.sunsetTime != null)
dayTlv.put(0x17, dayData.sunsetTime); dayTlv.put(0x17, dayData.sunsetTime);
if (dayData.moonRiseTime != null) if (dayData.moonRiseTime != null && dayData.moonRiseTime != 0)
dayTlv.put(0x1a, dayData.moonRiseTime); dayTlv.put(0x1a, dayData.moonRiseTime);
if (dayData.moonSetTime != null) if (dayData.moonSetTime != null && dayData.moonSetTime != 0)
dayTlv.put(0x1b, dayData.moonSetTime); dayTlv.put(0x1b, dayData.moonSetTime);
} }
if (dayData.moonPhase != null && settings.moonPhaseSupported) if (dayData.moonPhase != null && settings.moonPhaseSupported)