Files
duooomi-android-sdk/sdk/src/main/kotlin/com/duooomi/ble/models/VersionInfo.kt
km2023 d655b13416 feat: implement Android BLE SDK with demo app
Complete Android port of duooomi-ios-sdk with 1:1 API parity.
Includes SDK library module and Jetpack Compose demo app.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 12:09:22 +08:00

23 lines
597 B
Kotlin

package com.duooomi.ble.models
import org.json.JSONObject
data class VersionInfo(
val version: String,
val type: String
) {
companion object {
fun fromJson(json: JSONObject): VersionInfo {
val typeValue = when {
json.has("type") && json.get("type") is String -> json.getString("type")
json.has("type") -> json.getInt("type").toString()
else -> ""
}
return VersionInfo(
version = json.optString("version", ""),
type = typeValue
)
}
}
}