diff --git a/resources/config_version.py b/resources/config_version.py index d462d45..31bbadc 100644 --- a/resources/config_version.py +++ b/resources/config_version.py @@ -7,7 +7,7 @@ parser.add_argument('ota_type', type=str) args = parser.parse_args() 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" with open('src/Config.h', 'r') as file: @@ -37,7 +37,7 @@ content_new = "" with open ('src/Config.h', 'r' ) as readfile: 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(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: writefile.write(content_new) diff --git a/src/Config.h b/src/Config.h index 2ef63e6..6ddea4c 100644 --- a/src/Config.h +++ b/src/Config.h @@ -3,7 +3,7 @@ #include "sdkconfig.h" #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_DATE "2024-12-03" diff --git a/src/PreferencesKeys.h b/src/PreferencesKeys.h index 446ef84..724180a 100644 --- a/src/PreferencesKeys.h +++ b/src/PreferencesKeys.h @@ -217,7 +217,7 @@ inline void initPreferences(Preferences* preferences) Log->println(lastConfigVer); Log->print("Current config version: "); - if(lastConfigVer >= NUKI_HUB_VERSION_INT) return; + if(lastConfigVer >= NUKI_HUB_VERSION_INT && lastConfigVer < 20000) return; if (lastConfigVer < 834) {