Skip to content

Commit

Permalink
solarforecast: Catch exception if return value is not json conform.
Browse files Browse the repository at this point in the history
  • Loading branch information
aschwith committed Mar 2, 2024
1 parent 629e601 commit f2e3610
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion solarforecast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ def poll_backend(self):
self.logger.error(f"Server error: {statusCode}")
return

responseJson = sessionrequest_response.json()
try:
responseJson = sessionrequest_response.json()
except Exception as e:
self.logger.error(f"Exception during json decoding: {str(e)}")
return

self.logger.debug(f"Json response: {responseJson}")

# Decode Json data:
Expand Down
4 changes: 2 additions & 2 deletions solarforecast/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ parameters:
valid_min: -180
valid_max: 180
description:
de: 'Azimutwinkel der Panelausrichtung (-180 bis 180 Grad). 0 Grad entspricht Süden'
en: 'Azimuth angle of panel direction (-180 to 180 degrees). 0 degree is equivalent to southern direction'
de: 'Azimutwinkel der Panelausrichtung (-180 bis 180 Grad). 0 Grad entspricht Süden, (-180 = north, -90 = east, 0 = south, 90 = west, 180 = north)'
en: 'Azimuth angle of panel direction (-180 to 180 degrees). 0 degree is equivalent to southern direction, (-180 = north, -90 = east, 0 = south, 90 = west, 180 = north)'
kwp:
type: num
mandatory: True
Expand Down

0 comments on commit f2e3610

Please sign in to comment.