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,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 = ""
@@ -10,3 +19,16 @@ with open ('src/Config.h', 'r' ) as readfile:
with open('src/Config.h', 'w') as writefile:
writefile.write(content_new)
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." + board):
os.remove("sdkconfig." + board)
if os.path.exists("sdkconfig." + board + "_dbg"):
os.remove("sdkconfig." + board + "_dbg")