Skip to content

Commit

Permalink
Fixed error in date from API
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Lindvig authored Jul 3, 2022
1 parent 145643d commit 97d1298
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/pollen_dk/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"codeowners": ["@J-Lindvig"],
"requirements": [],
"iot_class": "cloud_polling",
"version": "0.2.1"
"version": "0.2.2"
}
3 changes: 1 addition & 2 deletions custom_components/pollen_dk/pollen_dk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def update(self):
r = self._session.get(POLLEN_URL)
if r.status_code == 200:
r_json = json.loads(r.json())
# for regionID in r_json.keys():
for regionID in r_json["fields"].keys():
if int(regionID) in self._regionIDs:
self._regions[regionID] = PollenRegion(
Expand All @@ -46,7 +45,7 @@ def __init__(self, regionID, pollenIDs, rawData):
self._ID = regionID
self._pollenIDs = pollenIDs
self._name = list(REGION_IDS.keys())[list(REGION_IDS.values()).index(regionID)]
self._date = rawData["date"]
self._date = rawData["date"]["stringValue"]
self._pollenTypes = {}

for pollenID, pollenData in rawData["data"]["mapValue"]["fields"].items():
Expand Down

0 comments on commit 97d1298

Please sign in to comment.