1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 19:36:50 +01:00

Zepp OS: Make Alexa an experimental feature

This commit is contained in:
José Rebelo 2023-06-10 17:15:36 +01:00
parent 3716a031ce
commit 58704a0eec
2 changed files with 9 additions and 3 deletions

View File

@ -450,7 +450,7 @@ public abstract class Huami2021Coordinator extends HuamiCoordinator {
}
public boolean supportsAlexa(final GBDevice device) {
return ZeppOsAlexaService.isSupported(getPrefs(device));
return experimentalFeatures(device) && ZeppOsAlexaService.isSupported(getPrefs(device));
}
private boolean supportsConfig(final GBDevice device, final ZeppOsConfigService.ConfigArg config) {
@ -474,4 +474,8 @@ public abstract class Huami2021Coordinator extends HuamiCoordinator {
public static boolean deviceHasConfig(final Prefs devicePrefs, final ZeppOsConfigService.ConfigArg config) {
return devicePrefs.getBoolean(Huami2021Coordinator.getPrefKnownConfig(config.name()), false);
}
public static boolean experimentalFeatures(final GBDevice device) {
return getPrefs(device).getBoolean("zepp_os_experimental_features", false);
}
}

View File

@ -148,8 +148,10 @@ public class ZeppOsAlexaService extends AbstractZeppOsService {
@Override
public void initialize(final TransactionBuilder builder) {
requestCapabilities(builder);
requestLanguages(builder);
if (Huami2021Coordinator.experimentalFeatures(getSupport().getDevice())) {
requestCapabilities(builder);
requestLanguages(builder);
}
}
public void requestCapabilities(final TransactionBuilder builder) {