mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor(firmware): Simplify ESP32 firmware check (#4272)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
85a6900b74
commit
b73a304452
8 changed files with 37 additions and 247 deletions
|
|
@ -236,7 +236,6 @@ constructor(
|
|||
}
|
||||
base.copy(
|
||||
requiresBootloaderUpgradeForOta = matchedQuirk.requiresBootloaderUpgradeForOta,
|
||||
supportsUnifiedOta = matchedQuirk.supportsUnifiedOta,
|
||||
bootloaderInfoUrl = matchedQuirk.infoUrl,
|
||||
)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -96,6 +96,19 @@ class DeviceHardwareRepositoryTest {
|
|||
assertEquals("tdeck-pro", result?.platformioTarget)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getDeviceHardwareByModel correctly sets isEsp32Arc for ESP32 devices`() = runTest(testDispatcher) {
|
||||
val hwModel = 50
|
||||
val entities = listOf(createEntity(hwModel, "t-deck", "T-Deck").copy(architecture = "esp32-s3"))
|
||||
|
||||
coEvery { localDataSource.getByHwModel(hwModel) } returns entities
|
||||
every { bootloaderOtaQuirksJsonDataSource.loadBootloaderOtaQuirksFromJsonAsset() } returns emptyList()
|
||||
|
||||
val result = repository.getDeviceHardwareByModel(hwModel).getOrNull()
|
||||
|
||||
assertEquals(true, result?.isEsp32Arc)
|
||||
}
|
||||
|
||||
private fun createEntity(hwModel: Int, target: String, displayName: String) = DeviceHardwareEntity(
|
||||
activelySupported = true,
|
||||
architecture = "esp32-s3",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue