From ea9cd7d905cca2e26b1f3a338669a69a0fae2fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Sun, 11 Jan 2026 11:40:27 +0100 Subject: [PATCH] Better handling of ratelimiting from Tibber (#160599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Hjelseth Høyer --- homeassistant/components/tibber/coordinator.py | 8 +++++++- homeassistant/components/tibber/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tibber/coordinator.py b/homeassistant/components/tibber/coordinator.py index 84fac8237c06..39fca55238cf 100644 --- a/homeassistant/components/tibber/coordinator.py +++ b/homeassistant/components/tibber/coordinator.py @@ -250,6 +250,12 @@ class TibberDataAPICoordinator(DataUpdateCoordinator[dict[str, TibberDevice]]): async def _async_update_data(self) -> dict[str, TibberDevice]: """Fetch the latest device capabilities from the Tibber Data API.""" client = await self._async_get_client() - devices: dict[str, TibberDevice] = await client.update_devices() + try: + devices: dict[str, TibberDevice] = await client.update_devices() + except tibber.exceptions.RateLimitExceededError as err: + raise UpdateFailed( + f"Rate limit exceeded, retry after {err.retry_after} seconds", + retry_after=err.retry_after, + ) from err self._build_sensor_lookup(devices) return devices diff --git a/homeassistant/components/tibber/manifest.json b/homeassistant/components/tibber/manifest.json index 9388d413c04a..127cc878bdc9 100644 --- a/homeassistant/components/tibber/manifest.json +++ b/homeassistant/components/tibber/manifest.json @@ -7,5 +7,5 @@ "documentation": "https://www.home-assistant.io/integrations/tibber", "iot_class": "cloud_polling", "loggers": ["tibber"], - "requirements": ["pyTibber==0.34.1"] + "requirements": ["pyTibber==0.34.4"] } diff --git a/requirements_all.txt b/requirements_all.txt index 7998e0c60c17..e39a0b188e7f 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1867,7 +1867,7 @@ pyRFXtrx==0.31.1 pySDCP==1 # homeassistant.components.tibber -pyTibber==0.34.1 +pyTibber==0.34.4 # homeassistant.components.dlink pyW215==0.8.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e19191dce29f..032fd4786b0c 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1595,7 +1595,7 @@ pyHomee==1.3.8 pyRFXtrx==0.31.1 # homeassistant.components.tibber -pyTibber==0.34.1 +pyTibber==0.34.4 # homeassistant.components.dlink pyW215==0.8.0