Skip to content
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

Migrate info to new ble api #1001

Open
wants to merge 18 commits into
base: makeevrserg/new-ble-api/dev
Choose a base branch
from

Conversation

makeevrserg
Copy link
Collaborator

Background

Migrate main screen module to new api

Changes

  • Add alarm feature
  • Add device color feature
  • Add GattInformation
  • Migrate components of info to new ble api

Test plan

  • Open app
  • See info screen loading, alarm working

@makeevrserg makeevrserg requested a review from LionZXY as a code owner December 11, 2024 11:51
Base automatically changed from makeevrserg/new-ble-api/connection-service to makeevrserg/new-ble-api/dev December 15, 2024 21:10
@makeevrserg makeevrserg force-pushed the makeevrserg/new-ble-api/info branch from cdafaf3 to 2e3cb15 Compare December 15, 2024 21:16
@makeevrserg makeevrserg requested a review from LionZXY December 15, 2024 22:00
@makeevrserg makeevrserg marked this pull request as draft December 16, 2024 12:52
@@ -9,4 +10,5 @@ interface FDevicePersistedStorage {
suspend fun addDevice(device: FDeviceBaseModel)
suspend fun removeDevice(id: String)
fun getAllDevices(): Flow<List<FDeviceBaseModel>>
suspend fun setCurrentDeviceColor(hardwareColor: HardwareColor)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not setDeviceColor(id: String, hardwareColor: HardwareColor) because we can't get color when not connected to device

override val humanReadableName: String = "Flipper $name"
override val humanReadableName: String = "Flipper $name",
@Serializable(HardwareColorSerializer::class)
val hardwareColor: FlipperZeroBle.HardwareColor
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be better to add interface ColoredDevice { val hardwareColor....} but we HardwareColor currently linked specificly to FlipperZero


enum HardwareColor {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locate HardwareColor specifically into FlipeprZeroBle because it's request now linked only for this device model

@@ -99,9 +100,10 @@ class UpdateScreenDecomposeComponent @AssistedInject constructor(
deeplink = deeplink,
deviceStatus = deviceStatus,
connectViewModel = connectViewModel,
hardwareColor = flipperColor,
hardwareColor = HardwareColor.fromValue(flipperColor.value), // TODO change after full migration
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other modules non-related to this PR still requires old HardwareColor

@makeevrserg makeevrserg marked this pull request as ready for review December 18, 2024 09:27
@makeevrserg makeevrserg force-pushed the makeevrserg/new-ble-api/dev branch from d7793ea to 08762db Compare December 18, 2024 09:29
@makeevrserg makeevrserg force-pushed the makeevrserg/new-ble-api/info branch from 6554b0c to b5bd897 Compare December 18, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants