Fix version math
This commit is contained in:
@@ -7,7 +7,7 @@ parser.add_argument('ota_type', type=str)
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
regex = r"\#define NUKI_HUB_VERSION \"(.*)\""
|
regex = r"\#define NUKI_HUB_VERSION \"(.*)\""
|
||||||
regex2 = r"\#define NUKI_HUB_VERSION_INT \(uint32_t\)\"(.*)\""
|
regex2 = r"\#define NUKI_HUB_VERSION_INT \(uint32_t\)(.*)"
|
||||||
version = "unknown"
|
version = "unknown"
|
||||||
|
|
||||||
with open('src/Config.h', 'r') as file:
|
with open('src/Config.h', 'r') as file:
|
||||||
@@ -37,7 +37,7 @@ content_new = ""
|
|||||||
with open ('src/Config.h', 'r' ) as readfile:
|
with open ('src/Config.h', 'r' ) as readfile:
|
||||||
file_content = readfile.read()
|
file_content = readfile.read()
|
||||||
content_new = re.sub(regex, "#define NUKI_HUB_VERSION \"" + str(version) + "-" + args.ota_type + str(number) + "\"", file_content, flags = re.M)
|
content_new = re.sub(regex, "#define NUKI_HUB_VERSION \"" + str(version) + "-" + args.ota_type + str(number) + "\"", file_content, flags = re.M)
|
||||||
content_new = re.sub(regex2, "#define NUKI_HUB_VERSION_INT (uint32_t)\"" + str(version_int) + "\"", content_new, flags = re.M)
|
content_new = re.sub(regex2, "#define NUKI_HUB_VERSION_INT (uint32_t)" + str(version_int), content_new, flags = re.M)
|
||||||
|
|
||||||
with open('src/Config.h', 'w') as writefile:
|
with open('src/Config.h', 'w') as writefile:
|
||||||
writefile.write(content_new)
|
writefile.write(content_new)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
#define NUKI_HUB_VERSION "9.03"
|
#define NUKI_HUB_VERSION "9.03"
|
||||||
#define NUKI_HUB_VERSION_INT (uint32_t)"903"
|
#define NUKI_HUB_VERSION_INT (uint32_t)903
|
||||||
#define NUKI_HUB_BUILD "unknownbuildnr"
|
#define NUKI_HUB_BUILD "unknownbuildnr"
|
||||||
#define NUKI_HUB_DATE "2024-12-03"
|
#define NUKI_HUB_DATE "2024-12-03"
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ inline void initPreferences(Preferences* preferences)
|
|||||||
Log->println(lastConfigVer);
|
Log->println(lastConfigVer);
|
||||||
Log->print("Current config version: ");
|
Log->print("Current config version: ");
|
||||||
|
|
||||||
if(lastConfigVer >= NUKI_HUB_VERSION_INT) return;
|
if(lastConfigVer >= NUKI_HUB_VERSION_INT && lastConfigVer < 20000) return;
|
||||||
|
|
||||||
if (lastConfigVer < 834)
|
if (lastConfigVer < 834)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user