From 9d27ab6d770ed1558971d9735ef5bb758c919eb6 Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Sun, 31 Dec 2023 20:18:29 +0000 Subject: [PATCH 1/3] Fix to sanity check for apps_dir default --- apps/predbat/predbat.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 511e38825..16e920144 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -10349,9 +10349,8 @@ def sanity(self): if not config_dir: self.log("WARN: Unable to find config directory in roots {}".format(CONFIG_ROOTS)) passed = False - else: - app_dirs.append(config_dir) - + + app_dir = config_dir + "/apps" appdaemon_config = config_dir + "/appdaemon.yaml" if config_dir and os.path.exists(appdaemon_config): with open(appdaemon_config, "r") as han: @@ -10366,12 +10365,9 @@ def sanity(self): sub_data = data["appdaemon"] if "app_dir" in sub_data: app_dir = sub_data["app_dir"] - if app_dir not in app_dirs: - app_dirs.append(app_dir) - self.log("Sanity: Got app_dir {}".format(app_dir)) - else: - self.log("WARN: app_dir is not set in appdaemon.yaml") - passed = False + if app_dir not in app_dirs: + app_dirs.append(app_dir) + self.log("Sanity: Got app_dir {}".format(app_dir)) elif data: self.log("WARN: appdaemon section is missing from appdaemon.yaml") passed = False From 6239a7d0d44d84a23c1b360bb155c7ba6c8b578f Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Sun, 31 Dec 2023 20:19:37 +0000 Subject: [PATCH 2/3] Update predbat.py --- apps/predbat/predbat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 16e920144..3cf3b10f3 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -18,7 +18,7 @@ import os import yaml -THIS_VERSION = "v7.14.30" +THIS_VERSION = "v7.14.31" TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z" TIME_FORMAT_SECONDS = "%Y-%m-%dT%H:%M:%S.%f%z" TIME_FORMAT_OCTOPUS = "%Y-%m-%d %H:%M:%S%z" From 820e8fe74071b3e238f37f873b1ce5000e03f581 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sun, 31 Dec 2023 20:20:54 +0000 Subject: [PATCH 3/3] [pre-commit.ci lite] apply automatic fixes --- apps/predbat/predbat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 3cf3b10f3..894d6b0d7 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -10349,7 +10349,7 @@ def sanity(self): if not config_dir: self.log("WARN: Unable to find config directory in roots {}".format(CONFIG_ROOTS)) passed = False - + app_dir = config_dir + "/apps" appdaemon_config = config_dir + "/appdaemon.yaml" if config_dir and os.path.exists(appdaemon_config):