diff --git a/.devcontainer/cbpi-default-dev-config/dashboard/cbpi_dashboard_1.json b/.devcontainer/cbpi-default-dev-config/dashboard/cbpi_dashboard_1.json deleted file mode 100644 index 92079a0..0000000 --- a/.devcontainer/cbpi-default-dev-config/dashboard/cbpi_dashboard_1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "elements": [] -} \ No newline at end of file diff --git a/cbpi/config/dashboard/cbpi_dashboard_1.json b/cbpi/config/dashboard/cbpi_dashboard_1.json deleted file mode 100644 index 92079a0..0000000 --- a/cbpi/config/dashboard/cbpi_dashboard_1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "elements": [] -} \ No newline at end of file diff --git a/cbpi/configFolder.py b/cbpi/configFolder.py index ef2169b..b35d4a1 100644 --- a/cbpi/configFolder.py +++ b/cbpi/configFolder.py @@ -96,13 +96,13 @@ class ConfigFolder: ['config.json', 'file'], ['craftbeerpi.service', 'file'], ['chromium.desktop', 'file'], - ['dashboard/cbpi_dashboard_1.json', 'file'], - ['dashboard/widgets', 'folder'], ['dashboard', 'folder'], + ['dashboard/widgets', 'folder'], ['fermenterrecipes', 'folder'], [self.logsFolderPath, 'folder'], ['recipes', 'folder'], ['upload', 'folder'] + #['dashboard/cbpi_dashboard_1.json', 'file'] no need to check - can be created with online editor ] for checking in required_config_content: if self.inform_missing_content(self.check_for_file_or_folder(os.path.join(self.configFolderPath, checking[0]), checking[1])): @@ -117,6 +117,13 @@ class ConfigFolder: print("of course you can also place your config files manually") print("***************************************************") return False + + # if cbpi_dashboard_1.json doesnt exist at the new location (configFolderPath/dashboard) + # we move every cbpi_dashboard_n.json file from the old location (configFolderPath) there. + # this could be a config zip file restore from version 4.0.7.a4 or prior. + if not (os.path.isfile(os.path.join(self.configFolderPath, 'dashboard', 'cbpi_dashboard_1.json'))): + for file in glob.glob(os.path.join(self.configFolderPath, 'cbpi_dashboard_*.json')): + shutil.move(file, os.path.join(self.configFolderPath, 'dashboard', os.path.basename(file))) def inform_missing_content(self, whatsmissing : str): if whatsmissing == "":