Skip to content

Commit

Permalink
Remove solcast API limit call which is broken (#1366)
Browse files Browse the repository at this point in the history
* Remove solcast API limit call which is broken

* [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] authored Aug 15, 2024
1 parent 65b63e7 commit fa9e6ad
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,14 +810,17 @@ def download_solcast_data(self):
for api_key in api_keys:
params = {"format": "json", "api_key": api_key.strip()}

url = f"{host}/json/reply/GetUserUsageAllowance"
data = self.cache_get_url(url, params, max_age=0)
if not data:
self.log("Warn: Solcast, could not access usage data, check your Solcast cloud settings")
else:
self.solcast_api_limit += data.get("daily_limit", None)
self.solcast_api_used += data.get("daily_limit_consumed", None)
self.log("Solcast API limit {} used {}".format(self.solcast_api_limit, self.solcast_api_used))
# API Limit no longer works - 15/8/24
# wait for Solcast to provide new API
#
# url = f"{host}/json/reply/GetUserUsageAllowance"
# data = self.cache_get_url(url, params, max_age=0)
# if not data:
# self.log("Warn: Solcast, could not access usage data, check your Solcast cloud settings")
# else:
# self.solcast_api_limit += data.get("daily_limit", None)
# self.solcast_api_used += data.get("daily_limit_consumed", None)
# self.log("Solcast API limit {} used {}".format(self.solcast_api_limit, self.solcast_api_used))

url = f"{host}/rooftop_sites"
data = self.cache_get_url(url, params, max_age=max_age)
Expand Down

0 comments on commit fa9e6ad

Please sign in to comment.