From 66f37d228ca9253752f8814b708be2f9210d57d0 Mon Sep 17 00:00:00 2001 From: dotKrad Date: Sat, 2 May 2020 22:02:48 -0400 Subject: [PATCH] Added details and fix a date problem --- custom_components/fpl/fplapi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/fpl/fplapi.py b/custom_components/fpl/fplapi.py index 657fa59..eb2796a 100644 --- a/custom_components/fpl/fplapi.py +++ b/custom_components/fpl/fplapi.py @@ -205,7 +205,8 @@ class FplApi(object): str(item), ) if match: - date = datetime.strptime(match.group(1), "%b. %d, %Y").date() + g1 = match.group(1).replace(".", "") + date = datetime.strptime(g1, "%b %d, %Y").date() usage = int(match.group(2)) cost = float(match.group(3)) max_temp = int(match.group(4)) @@ -238,5 +239,6 @@ class FplApi(object): data["remaining_days"] = remaining_days data["mtd_kwh"] = total_kw data["average_kwh"] = avg_kw + data["details"] = details return data