Skip to content

Commit 15ca12c

Browse files
authored
Add files via upload
1 parent 8c3ca8f commit 15ca12c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

custom_components/pollen_dk/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"codeowners": ["@J-Lindvig"],
88
"requirements": [],
99
"iot_class": "cloud_polling",
10-
"version": "0.1"
10+
"version": "0.2"
1111
}

custom_components/pollen_dk/pollen_dk_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ def __init__(self, pollenID, rawData, date):
8080
level = dateKey["prediction"]
8181
if level:
8282
self._predictions.append(PollenPrediction(date, int(level)))
83+
if self._predictions:
84+
self._predictions.sort(
85+
key=lambda date: datetime.strptime(date._date, "%d-%m-%Y")
86+
)
8387

8488
def getID(self):
8589
return self._ID

0 commit comments

Comments
 (0)