mirror of
https://github.com/boneIO-eu/esphome.git
synced 2026-04-10 13:00:27 +02:00
change fw creation
This commit is contained in:
@@ -14,11 +14,12 @@ cwd = os.getcwd()
|
|||||||
|
|
||||||
|
|
||||||
pattern = r"name:\s*(\S+)"
|
pattern = r"name:\s*(\S+)"
|
||||||
json_destination = "../website/public/esp"
|
json_destination = "../website2/public/fwesp"
|
||||||
firmware_destination = "../website/public/esp/firmware"
|
firmware_destination = "../website2/public/fwesp/firmware"
|
||||||
|
firmware_destination2 = "../esphome_uploader/firmware"
|
||||||
|
|
||||||
|
|
||||||
def json_pattern(firmware_name):
|
def json_pattern(firmware_name, chip_family="ESP32"):
|
||||||
return {
|
return {
|
||||||
"name": "ESPHome",
|
"name": "ESPHome",
|
||||||
"version": "2025.8.2",
|
"version": "2025.8.2",
|
||||||
@@ -27,10 +28,10 @@ def json_pattern(firmware_name):
|
|||||||
"new_install_prompt_erase": False,
|
"new_install_prompt_erase": False,
|
||||||
"builds": [
|
"builds": [
|
||||||
{
|
{
|
||||||
"chipFamily": "ESP32",
|
"chipFamily": chip_family,
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"path": f"/esp/firmware/{firmware_name}.bin",
|
"path": f"/fwesp/firmware/{firmware_name}.bin",
|
||||||
"offset": 0,
|
"offset": 0,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -51,7 +52,9 @@ def get_boneio_name(file):
|
|||||||
|
|
||||||
|
|
||||||
for file in glob.glob("*.yaml"):
|
for file in glob.glob("*.yaml"):
|
||||||
|
# for file in glob.glob("boneio-dimmer_gen2_8ch-v0_1.yaml"):
|
||||||
filename = get_boneio_name(file)
|
filename = get_boneio_name(file)
|
||||||
|
chip_family = "ESP32-S3" if "gen2" in filename else "ESP32"
|
||||||
if not filename:
|
if not filename:
|
||||||
print("No file found.")
|
print("No file found.")
|
||||||
break
|
break
|
||||||
@@ -66,12 +69,13 @@ for file in glob.glob("*.yaml"):
|
|||||||
print("Process failed, breaking.")
|
print("Process failed, breaking.")
|
||||||
break
|
break
|
||||||
shutil.copyfile(firmware_path, f"{firmware_destination}/{filename}.bin")
|
shutil.copyfile(firmware_path, f"{firmware_destination}/{filename}.bin")
|
||||||
|
shutil.copyfile(firmware_path, f"{firmware_destination2}/{filename}.bin")
|
||||||
|
|
||||||
with open(
|
with open(
|
||||||
f"{json_destination}/{filename}.json", "w", encoding="utf-8"
|
f"{json_destination}/{filename}.json", "w", encoding="utf-8"
|
||||||
) as f:
|
) as f:
|
||||||
json.dump(
|
json.dump(
|
||||||
json_pattern(firmware_name=filename),
|
json_pattern(firmware_name=filename, chip_family=chip_family),
|
||||||
f,
|
f,
|
||||||
ensure_ascii=False,
|
ensure_ascii=False,
|
||||||
indent=4,
|
indent=4,
|
||||||
|
|||||||
Reference in New Issue
Block a user