Fix dashboard download for ESP32 variants (#5355)

This commit is contained in:
Kuba Szczodrzyński 2023-09-08 23:20:26 +02:00 committed by GitHub
parent d9523a0cbf
commit 9cf115a752
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -540,7 +540,10 @@ class DownloadListRequestHandler(BaseHandler):
self.send_error(404) self.send_error(404)
return return
from esphome.components.esp32 import get_download_types as esp32_types from esphome.components.esp32 import (
get_download_types as esp32_types,
VARIANTS as ESP32_VARIANTS,
)
from esphome.components.esp8266 import get_download_types as esp8266_types from esphome.components.esp8266 import get_download_types as esp8266_types
from esphome.components.rp2040 import get_download_types as rp2040_types from esphome.components.rp2040 import get_download_types as rp2040_types
from esphome.components.libretiny import get_download_types as libretiny_types from esphome.components.libretiny import get_download_types as libretiny_types
@ -551,7 +554,7 @@ class DownloadListRequestHandler(BaseHandler):
downloads = rp2040_types(storage_json) downloads = rp2040_types(storage_json)
elif platform == const.PLATFORM_ESP8266: elif platform == const.PLATFORM_ESP8266:
downloads = esp8266_types(storage_json) downloads = esp8266_types(storage_json)
elif platform == const.PLATFORM_ESP32: elif platform.upper() in ESP32_VARIANTS:
downloads = esp32_types(storage_json) downloads = esp32_types(storage_json)
elif platform == const.PLATFORM_BK72XX: elif platform == const.PLATFORM_BK72XX:
downloads = libretiny_types(storage_json) downloads = libretiny_types(storage_json)