From ee5325418aba322d709628db2493dae352574d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sat, 12 Aug 2023 12:53:54 +0100 Subject: [PATCH] Zepp OS: Fix shortcut cards setting on Zepp OS 2.1 --- .../huami/zeppos/services/ZeppOsShortcutCardsService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsShortcutCardsService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsShortcutCardsService.java index d6cc75c95..a4506d6e4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsShortcutCardsService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsShortcutCardsService.java @@ -134,7 +134,7 @@ public class ZeppOsShortcutCardsService extends AbstractZeppOsService { case CMD_CAPABILITIES_RESPONSE: version = payload[1]; getSupport().evaluateGBDeviceEvent(new GBDeviceEventUpdatePreferences(PREF_VERSION, version)); - if (version != 3) { + if (version != 3 && version != 4) { LOG.warn("Unsupported shortcut cards service version {}", version); return; } @@ -268,6 +268,7 @@ public class ZeppOsShortcutCardsService extends AbstractZeppOsService { } public static boolean isSupported(final Prefs devicePrefs) { - return devicePrefs.getInt(PREF_VERSION, 0) == 3; + final int version = devicePrefs.getInt(PREF_VERSION, 0); + return version == 3 || version == 4; } }