From ca667865cf7216e75cf8a4c26093ebc2b4eb0641 Mon Sep 17 00:00:00 2001 From: Christophe Camicas Date: Fri, 18 Oct 2024 09:56:29 +0200 Subject: [PATCH] fix api change --- custom_components/gazdebordeaux/gazdebordeaux.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/custom_components/gazdebordeaux/gazdebordeaux.py b/custom_components/gazdebordeaux/gazdebordeaux.py index 568bfa8..5df57f2 100644 --- a/custom_components/gazdebordeaux/gazdebordeaux.py +++ b/custom_components/gazdebordeaux/gazdebordeaux.py @@ -6,9 +6,9 @@ from json.decoder import JSONDecodeError from typing import List, Any -DATA_URL = "https://life.gazdebordeaux.fr/api{0}/consumptions" -LOGIN_URL = "https://life.gazdebordeaux.fr/api/login_check" -ME_URL = "https://life.gazdebordeaux.fr/api/users/me" +DATA_URL = "https://lifeapi.gazdebordeaux.fr{0}/consumptions" +LOGIN_URL = "https://lifeapi.gazdebordeaux.fr/login_check" +ME_URL = "https://lifeapi.gazdebordeaux.fr/users/me" INPUT_DATE_FORMAT = "%Y-%m-%d" @@ -59,7 +59,7 @@ async def async_get_total_usage(self): d = monthly_data["total"] return TotalUsageRead( - amountOfEnergy = d["amountOfEnergy"], + amountOfEnergy = d["kwh"], volumeOfEnergy = d["volumeOfEnergy"], price = d["price"], ) @@ -75,7 +75,7 @@ async def async_get_daily_usage(self, start: datetime|None, end: datetime|None) continue usageReads.append(DailyUsageRead( date = datetime.strptime(d, INPUT_DATE_FORMAT).replace(tzinfo=paris_tz), - amountOfEnergy = daily_data[d]["amountOfEnergy"], + amountOfEnergy = daily_data[d]["kwh"], volumeOfEnergy = daily_data[d]["volumeOfEnergy"], price = daily_data[d]["price"], ratio = daily_data[d]["ratio"],