Skip to content

Commit

Permalink
Prevent API key check after 429
Browse files Browse the repository at this point in the history
  • Loading branch information
autoSteve committed Oct 19, 2024
1 parent 1782fdf commit 8897b4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/solcast_solar/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/BJReplay/ha-solcast-solar/issues",
"requirements": ["aiohttp>=3.8.5", "aiofiles>=23.2.0", "datetime>=4.3", "isodate>=0.6.1"],
"version": "4.2.2"
"version": "4.2.3"
}
2 changes: 2 additions & 0 deletions custom_components/solcast_solar/solcastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ def redact_lat_lon(s) -> str:
resp_json = json.loads(await f.read())
status = 200
for i in resp_json['sites']:
if i.get('api_key') is None:
continue
if i.get('api_key') not in sp:
status = 429
_LOGGER.debug("API key has changed so sites cache is invalid, not loading cached data")
Expand Down

0 comments on commit 8897b4c

Please sign in to comment.