Skip to content

Commit

Permalink
Debug info for solcast (#1164)
Browse files Browse the repository at this point in the history
* Debug info for solcast

* [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>
  • Loading branch information
springfall2008 and pre-commit-ci-lite[bot] committed Jun 2, 2024
1 parent 8de840c commit d829ae3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if not "PRED_GLOBAL" in globals():
PRED_GLOBAL = {}

THIS_VERSION = "v7.21.4"
THIS_VERSION = "v7.21.5"
PREDBAT_FILES = ["predbat.py"]
TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
TIME_FORMAT_SECONDS = "%Y-%m-%dT%H:%M:%S.%f%z"
Expand Down Expand Up @@ -5071,7 +5071,8 @@ def cache_get_url(self, url, params, max_age=8 * 60):
r = requests.get(url, params=params)
try:
data = r.json()
except requests.exceptions.JSONDecodeError:
except requests.exceptions.JSONDecodeError as e:
self.log("Warn: Error downloading data from url {}, error {} data was {}".format(url, e, r.content))
if data:
self.log("Warn: Error downloading data from url {}, using cached data age {} minutes".format(url, self.dp1(age_minutes)))
else:
Expand Down

0 comments on commit d829ae3

Please sign in to comment.