mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
Исправляем код универсальной версии для обновления
This commit is contained in:
@@ -20,17 +20,17 @@ littlefsSrcPath = ".pio/build/" + deviceName + "/littlefs.bin"
|
|||||||
|
|
||||||
if Path(firmwareSrcPath).is_file():
|
if Path(firmwareSrcPath).is_file():
|
||||||
print("Ok...... \"" + firmwareSrcPath + "\" Exist!")
|
print("Ok...... \"" + firmwareSrcPath + "\" Exist!")
|
||||||
firmwareDstPath = "iotm/" + deviceName + "/999/firmware.bin"
|
firmwareDstPath = "iotm/" + deviceName + "/400/firmware.bin"
|
||||||
Path(firmwareDstPath).parent.mkdir(parents=True, exist_ok=True)
|
Path(firmwareDstPath).parent.mkdir(parents=True, exist_ok=True)
|
||||||
shutil.copy(firmwareSrcPath, firmwareDstPath)
|
shutil.copy(firmwareSrcPath, firmwareDstPath)
|
||||||
|
|
||||||
if Path(littlefsSrcPath).is_file():
|
if Path(littlefsSrcPath).is_file():
|
||||||
print("Ok...... \"" + littlefsSrcPath + "\" Exist!")
|
print("Ok...... \"" + littlefsSrcPath + "\" Exist!")
|
||||||
littlefsDstPath = "iotm/" + deviceName + "/999/littlefs.bin"
|
littlefsDstPath = "iotm/" + deviceName + "/400/littlefs.bin"
|
||||||
Path(littlefsDstPath).parent.mkdir(parents=True, exist_ok=True)
|
Path(littlefsDstPath).parent.mkdir(parents=True, exist_ok=True)
|
||||||
shutil.copy(littlefsSrcPath, littlefsDstPath)
|
shutil.copy(littlefsSrcPath, littlefsDstPath)
|
||||||
|
|
||||||
versionsJson = json.loads('{"' + deviceName + '": {"0": "999"}}')
|
versionsJson = json.loads('{"' + deviceName + '": {"0": "400"}}')
|
||||||
with open("iotm/ver.json", "w", encoding='utf-8') as write_file:
|
with open("iotm/ver.json", "w", encoding='utf-8') as write_file:
|
||||||
json.dump(versionsJson, write_file, ensure_ascii=False, indent=4, sort_keys=False)
|
json.dump(versionsJson, write_file, ensure_ascii=False, indent=4, sort_keys=False)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user