From 5b4a65c42fd1fcd34b05167ed1276f2c06526136 Mon Sep 17 00:00:00 2001 From: Thomas Papendieck <14850347+tpd-opitz@users.noreply.github.com> Date: Tue, 30 Sep 2025 18:57:30 +0200 Subject: [PATCH 1/2] Update tariff.py - request quarter hourly prices --- packages/modules/electricity_tariffs/tibber/tariff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/modules/electricity_tariffs/tibber/tariff.py b/packages/modules/electricity_tariffs/tibber/tariff.py index 1bcb32283d..048819e3eb 100644 --- a/packages/modules/electricity_tariffs/tibber/tariff.py +++ b/packages/modules/electricity_tariffs/tibber/tariff.py @@ -22,7 +22,7 @@ def _get_sorted_price_data(response_json: Dict, key: str): def fetch_prices(config: TibberTariffConfiguration) -> Dict[int, float]: headers = {'Authorization': 'Bearer ' + config.token, 'Content-Type': 'application/json'} data = '{ "query": "{viewer {home(id:\\"' + config.home_id + \ - '\\") {currentSubscription {priceInfo {today {total startsAt} tomorrow {total startsAt}}}}}}" }' + '\\") {currentSubscription {priceInfo (resolution: QUARTER_HOURLY) {today {total startsAt} tomorrow {total startsAt}}}}}}" }' response = req.get_http_session().post('https://api.tibber.com/v1-beta/gql', headers=headers, data=data, timeout=6) response_json = response.json() if response_json.get("errors") is None: From b2d46bb9207a7f3e2c10f69471cd572bf0447832 Mon Sep 17 00:00:00 2001 From: Thomas Papendieck <14850347+tpd-opitz@users.noreply.github.com> Date: Tue, 30 Sep 2025 19:05:50 +0200 Subject: [PATCH 2/2] Update tariff_test.py - accept quart houly prices --- .../modules/electricity_tariffs/tibber/tariff_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/modules/electricity_tariffs/tibber/tariff_test.py b/packages/modules/electricity_tariffs/tibber/tariff_test.py index e8b9a66ae2..3259e22ccb 100644 --- a/packages/modules/electricity_tariffs/tibber/tariff_test.py +++ b/packages/modules/electricity_tariffs/tibber/tariff_test.py @@ -27,6 +27,9 @@ def test_fetch_prices(monkeypatch, requests_mock): {"priceInfo": {"today": [{"total": 0.8724, "startsAt": "2023-10-27T00:00:00.000+02:00"}, {"total": 0.8551, "startsAt": "2023-10-27T01:00:00.000+02:00"}, + {"total": 0.8552, "startsAt": "2023-10-27T01:15:00.000+02:00"}, + {"total": 0.8553, "startsAt": "2023-10-27T01:30:00.000+02:00"}, + {"total": 0.8554, "startsAt": "2023-10-27T01:45:00.000+02:00"}, {"total": 0.8389, "startsAt": "2023-10-27T02:00:00.000+02:00"}, {"total": 0.8189, "startsAt": "2023-10-27T03:00:00.000+02:00"}, {"total": 0.8544, "startsAt": "2023-10-27T04:00:00.000+02:00"}, @@ -35,6 +38,9 @@ def test_fetch_prices(monkeypatch, requests_mock): {"total": 1.6862, "startsAt": "2023-10-27T07:00:00.000+02:00"}, {"total": 2.3264, "startsAt": "2023-10-27T08:00:00.000+02:00"}, {"total": 2.3024, "startsAt": "2023-10-27T09:00:00.000+02:00"}, + {"total": 2.3124, "startsAt": "2023-10-27T09:15:00.000+02:00"}, + {"total": 2.3224, "startsAt": "2023-10-27T09:30:00.000+02:00"}, + {"total": 2.3324, "startsAt": "2023-10-27T09:45:00.000+02:00"}, {"total": 1.7204, "startsAt": "2023-10-27T10:00:00.000+02:00"}, {"total": 1.7213, "startsAt": "2023-10-27T11:00:00.000+02:00"}, {"total": 1.8697, "startsAt": "2023-10-27T12:00:00.000+02:00"}, @@ -56,6 +62,9 @@ def test_fetch_prices(monkeypatch, requests_mock): "1698382800": 0.0016862, "1698386400": 0.0023264, "1698390000": 0.0023024, + "1698390000": 0.0023124, + "1698390000": 0.0023224, + "1698390000": 0.0023324, "1698393600": 0.0017204, "1698397200": 0.0017213, "1698400800": 0.0018697,