mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Zepp OS: Fix setting of unknown button press apps
This commit is contained in:
parent
be07545eca
commit
fe9b88df17
@ -574,7 +574,21 @@ public class ZeppOsConfigService extends AbstractZeppOsService {
|
||||
switch (configArg) {
|
||||
case UPPER_BUTTON_LONG_PRESS:
|
||||
case LOWER_BUTTON_PRESS:
|
||||
return MapUtils.reverse(Huami2021MenuType.displayItemNameLookup).get(value);
|
||||
final String itemHex = MapUtils.reverse(Huami2021MenuType.displayItemNameLookup).get(value);
|
||||
if (itemHex != null) {
|
||||
return itemHex;
|
||||
}
|
||||
|
||||
// Unknown button press value - attempt to parse it as hex
|
||||
final Matcher matcher = Pattern.compile("^([0-9A-F]{8})$").matcher(value);
|
||||
if (matcher.matches()) {
|
||||
LOG.debug("Sending unknown button press item {} as hex", value);
|
||||
return value;
|
||||
}
|
||||
|
||||
LOG.warn("Failed to map button press value {}", value);
|
||||
|
||||
return null;
|
||||
case DATE_FORMAT:
|
||||
return value.replace("/", ".");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user