mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(model): Make NetworkDeviceHardware robust to unknown JSON keys (#3880)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
7e3d5c0619
commit
0c127bc6b3
2 changed files with 7 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ dependencies {
|
|||
implementation(projects.core.strings)
|
||||
|
||||
implementation(libs.androidx.annotation)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
implementation(libs.timber)
|
||||
implementation(libs.zxing.android.embedded) { isTransitive = false }
|
||||
implementation(libs.zxing.core)
|
||||
|
|
|
|||
|
|
@ -17,10 +17,14 @@
|
|||
|
||||
package org.meshtastic.core.model
|
||||
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonIgnoreUnknownKeys
|
||||
|
||||
@Serializable
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@JsonIgnoreUnknownKeys
|
||||
data class NetworkDeviceHardware(
|
||||
@SerialName("activelySupported") val activelySupported: Boolean = false,
|
||||
@SerialName("architecture") val architecture: String = "",
|
||||
|
|
@ -30,9 +34,11 @@ data class NetworkDeviceHardware(
|
|||
@SerialName("hwModel") val hwModel: Int = 0,
|
||||
@SerialName("hwModelSlug") val hwModelSlug: String = "",
|
||||
@SerialName("images") val images: List<String>? = null,
|
||||
@SerialName("key") val key: String? = null,
|
||||
@SerialName("partitionScheme") val partitionScheme: String? = null,
|
||||
@SerialName("platformioTarget") val platformioTarget: String = "",
|
||||
@SerialName("requiresDfu") val requiresDfu: Boolean? = null,
|
||||
@SerialName("supportLevel") val supportLevel: Int? = null,
|
||||
@SerialName("tags") val tags: List<String>? = null,
|
||||
@SerialName("variant") val variant: String? = null,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue