1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-15 01:32:19 +01:00

Add dashboard API to get firmware binaries (#4675)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Kuba Szczodrzyński
2023-09-01 08:17:33 +02:00
committed by GitHub
parent f8a03be2f1
commit c3332e4a39
4 changed files with 94 additions and 25 deletions

View File

@@ -84,6 +84,23 @@ def get_board(core_obj=None):
return (core_obj or CORE).data[KEY_ESP32][KEY_BOARD]
def get_download_types(storage_json):
return [
{
"title": "Modern format",
"description": "For use with ESPHome Web and other tools.",
"file": "firmware-factory.bin",
"download": f"{storage_json.name}-factory.bin",
},
{
"title": "Legacy format",
"description": "For use with ESPHome Flasher.",
"file": "firmware.bin",
"download": f"{storage_json.name}.bin",
},
]
def only_on_variant(*, supported=None, unsupported=None):
"""Config validator for features only available on some ESP32 variants."""
if supported is not None and not isinstance(supported, list):