mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 13:26:50 +01:00
Zepp OS: Make Alexa an experimental feature
This commit is contained in:
parent
3716a031ce
commit
58704a0eec
@ -450,7 +450,7 @@ public abstract class Huami2021Coordinator extends HuamiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean supportsAlexa(final GBDevice device) {
|
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) {
|
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) {
|
public static boolean deviceHasConfig(final Prefs devicePrefs, final ZeppOsConfigService.ConfigArg config) {
|
||||||
return devicePrefs.getBoolean(Huami2021Coordinator.getPrefKnownConfig(config.name()), false);
|
return devicePrefs.getBoolean(Huami2021Coordinator.getPrefKnownConfig(config.name()), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean experimentalFeatures(final GBDevice device) {
|
||||||
|
return getPrefs(device).getBoolean("zepp_os_experimental_features", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,9 +148,11 @@ public class ZeppOsAlexaService extends AbstractZeppOsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(final TransactionBuilder builder) {
|
public void initialize(final TransactionBuilder builder) {
|
||||||
|
if (Huami2021Coordinator.experimentalFeatures(getSupport().getDevice())) {
|
||||||
requestCapabilities(builder);
|
requestCapabilities(builder);
|
||||||
requestLanguages(builder);
|
requestLanguages(builder);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void requestCapabilities(final TransactionBuilder builder) {
|
public void requestCapabilities(final TransactionBuilder builder) {
|
||||||
write(builder, CMD_CAPABILITIES_REQUEST);
|
write(builder, CMD_CAPABILITIES_REQUEST);
|
||||||
|
Loading…
Reference in New Issue
Block a user