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>
23 lines
597 B
Kotlin
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
|
|
)
|
|
}
|
|
}
|
|
}
|