Skip to content

Commit

Permalink
fix: rest api json
Browse files Browse the repository at this point in the history
  • Loading branch information
chilikla authored Nov 26, 2024
1 parent a72005a commit ae2a08e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/yerushamayim/data_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ def _extract_data(self) -> YerushamayimData:

rain_data = {}
wind_data = {}
_LOGGER.debug("rest_api", self.rest_api)
# _LOGGER.debug("rest_api", self.rest_api)
if self.rest_api is not None and self.rest_api.data:
try:
rest = json.loads(self.rest_api.data)
rest_data = {}
for line in self.rest_api.data.strip().split('\n'):
for line in rest.strip().split('\n'):
parts = line.split('\t')
if len(parts) >= 3:
key = parts[1].split(':')[0].strip()
Expand Down

0 comments on commit ae2a08e

Please sign in to comment.