1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-29 05:16:51 +01:00

Passing BarcodeId as value if not null

This commit is contained in:
Gabriele Monaco 2023-09-19 16:52:19 +02:00
parent 89f57243cf
commit 492119f7ee

View File

@ -1452,7 +1452,11 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
JSONObject o = new JSONObject(); JSONObject o = new JSONObject();
o.put("id", card.getId()); o.put("id", card.getId());
o.put("name", renderUnicodeAsImage(cropToLength(card.getName(),40))); o.put("name", renderUnicodeAsImage(cropToLength(card.getName(),40)));
o.put("value", card.getCardId()); if (card.getBarcodeId() != null) {
o.put("value", card.getBarcodeId());
} else {
o.put("value", card.getCardId());
}
o.put("type", card.getBarcodeFormat().toString()); o.put("type", card.getBarcodeFormat().toString());
if (card.getExpiry() != null) if (card.getExpiry() != null)
o.put("expiration", card.getExpiry().getTime()/1000); o.put("expiration", card.getExpiry().getTime()/1000);