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

@ -30,11 +30,6 @@ data class BootloaderOtaQuirk(
* one-time bootloader upgrade (typically via USB) before DFU updates from the app work.
*/
@SerialName("requiresBootloaderUpgradeForOta") val requiresBootloaderUpgradeForOta: Boolean = false,
/**
* Indicates that the device supports the ESP32 Unified OTA protocol. When true, the app will use the unified OTA
* handler instead of Nordic DFU.
*/
@SerialName("supportsUnifiedOta") val supportsUnifiedOta: Boolean = false,
/** Optional URL pointing to documentation on how to update the bootloader. */
@SerialName("infoUrl") val infoUrl: String? = null,
)

View file

@ -38,7 +38,10 @@ data class DeviceHardware(
val requiresBootloaderUpgradeForOta: Boolean? = null,
/** Optional URL pointing to documentation for upgrading the bootloader. */
val bootloaderInfoUrl: String? = null,
val supportsUnifiedOta: Boolean = false,
val supportLevel: Int? = null,
val tags: List<String>? = null,
)
) {
/** Returns true if the device architecture is ESP32-based. */
val isEsp32Arc: Boolean
get() = architecture.startsWith("esp32", ignoreCase = true)
}