Fixes/Enhancements for pio/preferences, new info page, add reboot button, remove old files (#451)

* Preferences

* Info page

* Info page

* Remove old files + Info page
This commit is contained in:
iranl
2024-08-12 17:53:00 +02:00
committed by GitHub
parent 21adca01e7
commit 346c5c65d1
59 changed files with 1459 additions and 1403 deletions

View File

@@ -1,9 +1,7 @@
""" PlatformIO POST script execution to copy updater """
Import("env")
import glob
import os
import shutil
import glob, re, shutil, os
from pathlib import Path
def get_board_name(env):
@@ -42,3 +40,13 @@ def remove_files(source, target, env):
env.AddPostAction("$BUILD_DIR/firmware.bin", copy_files)
env.AddPostAction("$BUILD_DIR/firmware.bin", remove_files)
regex = r"\#define NUKI_HUB_DATE \"(.*)\""
content_new = ""
with open ('../src/Config.h', 'r' ) as readfile:
file_content = readfile.read()
content_new = re.sub(regex, "#define NUKI_HUB_DATE \"unknownbuilddate\"", file_content, flags = re.M)
with open('../src/Config.h', 'w') as writefile:
writefile.write(content_new)

View File

@@ -1,6 +1,15 @@
Import("env")
import re, shutil, os
from datetime import datetime, timezone
def recursive_purge(dir, pattern):
if os.path.isdir(dir):
for f in os.listdir(dir):
if os.path.isdir(os.path.join(dir, f)):
recursive_purge(os.path.join(dir, f), pattern)
elif re.search(pattern, os.path.join(dir, f)):
os.remove(os.path.join(dir, f))
regex = r"\#define NUKI_HUB_DATE \"(.*)\""
content_new = ""
@@ -12,3 +21,12 @@ with open('../src/Config.h', 'w') as writefile:
writefile.write(content_new)
shutil.copy("../src/main.cpp", "src/main.cpp")
recursive_purge("managed_components", ".component_hash")
if env.get('BOARD_MCU') == "esp32":
board = "esp32dev"
else:
board = env.get('BOARD_MCU')
if os.path.exists("sdkconfig.updater_" + board):
os.remove("sdkconfig." + board)

View File

@@ -12,4 +12,11 @@ CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
CONFIG_ARDUINO_SELECTIVE_HTTPClient=n
CONFIG_ARDUINO_SELECTIVE_WebServer=n
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN=y
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN=y
CONFIG_LOG_COLORS=n
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=n
CONFIG_LOG_MAXIMUM_LEVEL=4
CONFIG_LOG_DEFAULT_LEVEL_NONE=y
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
CONFIG_BOOTLOADER_LOG_LEVEL=1