TTLock is a global provider of solutions for smart locks. We provide PCBA and softwares for lock manufactures and end users. We provide open API/SDK for developers. With these APIs/SDKs, you can develop your own applications to manage smart locks. The SDK here is for mobile app to communicate with locks via bluetooth.
MIT License
13
stars
12
forks
source link
TTLock: Battery Value Variations between SDK and API #35
We've noticed some inconsistencies in the battery values retrieved from the TTLock SDK and the TTLock API. This affects both Android and iOS devices across multiple models. Below, We've listed the devices along with the observed battery values.
iOS SDK Method:
TTLock.getElectricQuantity(withLockData: lockData) { value in
completion(.success(value))
} failure: { _, errorMSG in
if let errorMSG {
completion(.failure(TTLockHelperError.custom(errorMSG)))
} else {
completion(.failure(TTLockHelperError.somethingWentWrong))
}
}
Android SDK Method:
private void getLockBatteryLevel() {
showConnectLockToast();
TTLockClient.getDefault().getBatteryLevel(
mCurrentLock.getLockData(),
mCurrentLock.getLockMac(),
new GetBatteryLevelCallback() {
@Override
public void onGetBatteryLevelSuccess(int electricQuantity) {
makeToast("lock battery is " + electricQuantity + "%");
}
@Override
public void onFail(LockError error) {
makeErrorToast(error);
}
});
}
Expected Behavior:
The battery values retrieved from both the SDK and the API should be consistent and accurate across all supported devices.
We've noticed some inconsistencies in the battery values retrieved from the TTLock SDK and the TTLock API. This affects both Android and iOS devices across multiple models. Below, We've listed the devices along with the observed battery values.
iOS SDK Method:
Android SDK Method:
Expected Behavior: The battery values retrieved from both the SDK and the API should be consistent and accurate across all supported devices.