Merge pull request #10905 from Jason2866/patch-1

warning if ESP8266 firmware is too big
This commit is contained in:
Theo Arends 2021-02-10 14:05:03 +01:00 committed by GitHub
commit 23d9aa6ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -29,6 +29,9 @@ if env["PIOPLATFORM"] != "espressif32":
ORG_FIRMWARE_SIZE = os.stat(bin_file).st_size ORG_FIRMWARE_SIZE = os.stat(bin_file).st_size
GZ_FIRMWARE_SIZE = os.stat(gzip_file).st_size GZ_FIRMWARE_SIZE = os.stat(gzip_file).st_size
print("Compression reduced firmware size by {:.0f}% (was {} bytes, now {} bytes)".format((GZ_FIRMWARE_SIZE / ORG_FIRMWARE_SIZE) * 100, ORG_FIRMWARE_SIZE, GZ_FIRMWARE_SIZE)) if ORG_FIRMWARE_SIZE > 995326:
print("\u001b[31;1m!!! Tasmota firmware size is too big with {} bytes. Max size is 995326 bytes !!! \u001b[0m".format(ORG_FIRMWARE_SIZE))
else:
print("Compression reduced firmware size by {:.0f}% (was {} bytes, now {} bytes)".format((GZ_FIRMWARE_SIZE / ORG_FIRMWARE_SIZE) * 100, ORG_FIRMWARE_SIZE, GZ_FIRMWARE_SIZE))
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_gzip]) env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_gzip])