Fetching caliberation value done
This commit is contained in:
@@ -3,6 +3,6 @@ package com.example.hpostesting.data.model.patient
|
||||
data class DeviceData (
|
||||
val deviceId: String? = "",
|
||||
val deviceType: String? = "",
|
||||
val coefficient: List<Double>? = null,
|
||||
val coefficients: List<Double>? = null,
|
||||
val calibratedAt: String
|
||||
)
|
||||
@@ -116,7 +116,19 @@ class DatabaseRepository : Repository {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getDeviceDataById(): List<DeviceData> {
|
||||
suspend fun getDeviceData(): List<DeviceData> {
|
||||
return db.collection("devices").get().await().toObjects(DeviceData::class.java)
|
||||
}
|
||||
|
||||
|
||||
suspend fun getDeviceDataById(deviceId: String): DeviceData? {
|
||||
val querySnapshot = db.collection("devices").get().await()
|
||||
val allDeviceDataList = querySnapshot.toObjects(DeviceData::class.java)
|
||||
|
||||
// Find the DeviceData object with the specified deviceId
|
||||
return allDeviceDataList.find { it.deviceId == deviceId }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user