-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Migrate update to new BLE api #1008
base: makeevrserg/new-ble-api/dev
Are you sure you want to change the base?
[DRAFT] Migrate update to new BLE api #1008
Conversation
BatteryState.Ready(gattInfo.isCharging, batteryLevel) | ||
} ?: BatteryState.Unknown | ||
} | ||
}.stateIn(viewModelScope, SharingStarted.Lazily, BatteryState.Unknown) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be lazily because we can't properly mock FGattInfoFeatureApi without it
@@ -124,6 +136,9 @@ class UpdateRequestViewModelTest { | |||
@Test | |||
fun `Open update request with sync`() = runTest { | |||
synchronizationState.emit(SynchronizationState.InProgress.Default(0f)) | |||
viewModel.getBatteryState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required to call batteryState initialization. It's lazy initialization
Background
Migration of all update modules into new api
Changes
Test plan
TODO