From 45c2897a76d3b083acb7d932467dcbe617a065d5 Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:54:01 +0000 Subject: [PATCH] Disable debug YAML in appDaemon mode (#1710) * Disable debug YAML in appDaemon mode * [pre-commit.ci lite] apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- apps/predbat/predbat.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index ae467930..9cdf6159 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -18,13 +18,19 @@ import hashlib import traceback +IS_APPDAEMON = False + # Import AppDaemon or our standalone wrapper try: import adbase as ad import appdaemon.plugins.hass.hassapi as hass + + IS_APPDAEMON = True except: import hass as hass + IS_APPDAEMON = False + import pytz import requests import yaml @@ -32,7 +38,7 @@ import asyncio import json -THIS_VERSION = "v8.8.3" +THIS_VERSION = "v8.8.4" # fmt: off PREDBAT_FILES = ["predbat.py", "config.py", "prediction.py", "gecloud.py","utils.py", "inverter.py", "ha.py", "download.py", "unit_test.py", "web.py", "predheat.py", "futurerate.py", "octopus.py", "solcast.py","execute.py", "plan.py", "fetch.py", "output.py", "userinterface.py"] @@ -707,7 +713,7 @@ def update_pred(self, scheduled=True): self.expose_config("holiday_days_left", self.holiday_days_left) self.log("Holiday days left is now {}".format(self.holiday_days_left)) - if self.debug_enable: + if self.debug_enable and not IS_APPDAEMON: self.create_debug_yaml() if self.had_errors: