refactor(firmware): Simplify ESP32 firmware check (#4272)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-01-20 20:42:16 -06:00 committed by GitHub
parent 85a6900b74
commit b73a304452
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 37 additions and 247 deletions

View file

@ -236,7 +236,6 @@ constructor(
}
base.copy(
requiresBootloaderUpgradeForOta = matchedQuirk.requiresBootloaderUpgradeForOta,
supportsUnifiedOta = matchedQuirk.supportsUnifiedOta,
bootloaderInfoUrl = matchedQuirk.infoUrl,
)
} else {

View file

@ -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",