Real Python fix ;-)

Thx @Staars
This commit is contained in:
Jason2866 2022-05-04 20:26:29 +02:00 committed by GitHub
parent bbdef78d5d
commit bc64dd6b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 8 deletions

View File

@ -36,13 +36,8 @@ FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
variants_dir = join(FRAMEWORK_DIR, "variants", "tasmota") variants_dir = join(FRAMEWORK_DIR, "variants", "tasmota")
def esp32_fetch_safemode_bin(chip): def esp32_fetch_safemode_bin(chip):
if "solo1" in env.subst("$BUILD_DIR"):
safemode_fw_url = "https://github.com/arendst/Tasmota-firmware/raw/main/firmware/tasmota32/tasmota32solo1-safemode.bin"
safemode_fw_name = join(variants_dir,"tasmota32solo1-safemode.bin")
else:
safemode_fw_url = "https://github.com/arendst/Tasmota-firmware/raw/main/firmware/tasmota32/tasmota" + chip[3:] + "-safemode.bin" safemode_fw_url = "https://github.com/arendst/Tasmota-firmware/raw/main/firmware/tasmota32/tasmota" + chip[3:] + "-safemode.bin"
safemode_fw_name = join(variants_dir,"tasmota" + chip[3:] + "-safemode.bin") safemode_fw_name = join(variants_dir,"tasmota" + ("32solo1" if "solo1" in env.subst("$BUILD_DIR") else chip[3:]) + "-safemode.bin")
if(exists(safemode_fw_name)): if(exists(safemode_fw_name)):
print("Safemode binary already in place.") print("Safemode binary already in place.")
return return
@ -54,7 +49,7 @@ def esp32_fetch_safemode_bin(chip):
def esp32_copy_new_safemode_bin(chip,new_local_safemode_fw): def esp32_copy_new_safemode_bin(chip,new_local_safemode_fw):
print("Copy new local safemode firmware to variants dir -> using it for further flashing operations") print("Copy new local safemode firmware to variants dir -> using it for further flashing operations")
safemode_fw_name = join(variants_dir,"tasmota" + chip[3:] + "-safemode.bin") safemode_fw_name = join(variants_dir,"tasmota" + ("32solo1" if "solo1" in env.subst("$BUILD_DIR") else chip[3:]) + "-safemode.bin")
if os.path.exists(variants_dir): if os.path.exists(variants_dir):
shutil.copy(new_local_safemode_fw, safemode_fw_name) shutil.copy(new_local_safemode_fw, safemode_fw_name)