diff --git a/homeassistant/components/tibber/__init__.py b/homeassistant/components/tibber/__init__.py index 7c44e797780cd253832f58338aa5e9d4b63c931e..3d63098b2e9047db4f19e624ab143158cb7e6512 100644 --- a/homeassistant/components/tibber/__init__.py +++ b/homeassistant/components/tibber/__init__.py @@ -61,13 +61,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: except ( TimeoutError, aiohttp.ClientError, - tibber.RetryableHttpException, + tibber.RetryableHttpExceptionError, ) as err: raise ConfigEntryNotReady("Unable to connect") from err - except tibber.InvalidLogin as exp: + except tibber.InvalidLoginError as exp: _LOGGER.error("Failed to login. %s", exp) return False - except tibber.FatalHttpException: + except tibber.FatalHttpExceptionError: return False await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) diff --git a/homeassistant/components/tibber/config_flow.py b/homeassistant/components/tibber/config_flow.py index abee3ea50bc82a44edec22482f050ad6e42a8aa5..2d4df5107a29ccf64e501bb60f678f23b3368b1b 100644 --- a/homeassistant/components/tibber/config_flow.py +++ b/homeassistant/components/tibber/config_flow.py @@ -47,12 +47,12 @@ class TibberConfigFlow(ConfigFlow, domain=DOMAIN): await tibber_connection.update_info() except TimeoutError: errors[CONF_ACCESS_TOKEN] = ERR_TIMEOUT - except tibber.InvalidLogin: + except tibber.InvalidLoginError: errors[CONF_ACCESS_TOKEN] = ERR_TOKEN except ( aiohttp.ClientError, - tibber.RetryableHttpException, - tibber.FatalHttpException, + tibber.RetryableHttpExceptionError, + tibber.FatalHttpExceptionError, ): errors[CONF_ACCESS_TOKEN] = ERR_CLIENT diff --git a/homeassistant/components/tibber/coordinator.py b/homeassistant/components/tibber/coordinator.py index c3746cb9a582bb9a00f7f0c34d0a609c76bbaf72..78841f9db91d7f1a3a371d34f13bfee82faa644f 100644 --- a/homeassistant/components/tibber/coordinator.py +++ b/homeassistant/components/tibber/coordinator.py @@ -49,9 +49,9 @@ class TibberDataCoordinator(DataUpdateCoordinator[None]): await self._tibber_connection.fetch_consumption_data_active_homes() await self._tibber_connection.fetch_production_data_active_homes() await self._insert_statistics() - except tibber.RetryableHttpException as err: + except tibber.RetryableHttpExceptionError as err: raise UpdateFailed(f"Error communicating with API ({err.status})") from err - except tibber.FatalHttpException: + except tibber.FatalHttpExceptionError: # Fatal error. Reload config entry to show correct error. self.hass.async_create_task( self.hass.config_entries.async_reload(self.config_entry.entry_id) diff --git a/homeassistant/components/tibber/manifest.json b/homeassistant/components/tibber/manifest.json index 1d8120a4321e38d17805b53603710c38d59afe9a..527364b6866c80aadffcd3c6093fc9bbf5520f0b 100644 --- a/homeassistant/components/tibber/manifest.json +++ b/homeassistant/components/tibber/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "loggers": ["tibber"], "quality_scale": "silver", - "requirements": ["pyTibber==0.28.2"] + "requirements": ["pyTibber==0.30.1"] } diff --git a/homeassistant/components/tibber/sensor.py b/homeassistant/components/tibber/sensor.py index a9090add49b37554ac43dac33a8d3451f9afcdb3..d6f8baa931c7a497fd172416960dbc4e8ad32710 100644 --- a/homeassistant/components/tibber/sensor.py +++ b/homeassistant/components/tibber/sensor.py @@ -411,7 +411,7 @@ class TibberSensorElPrice(TibberSensor): return res = self._tibber_home.current_price_data() - self._attr_native_value, price_level, self._last_updated = res + self._attr_native_value, price_level, self._last_updated, _ = res self._attr_extra_state_attributes["price_level"] = price_level attrs = self._tibber_home.current_attributes() diff --git a/requirements_all.txt b/requirements_all.txt index 6a833b546bd4887d350ca8bfec5a2faec6c39df1..370012e3e1573b879bbd046f53fe4a5f9afa8d17 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1707,7 +1707,7 @@ pyRFXtrx==0.31.1 pySDCP==1 # homeassistant.components.tibber -pyTibber==0.28.2 +pyTibber==0.30.1 # homeassistant.components.dlink pyW215==0.7.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 93005222ffd956cfef4f8ea23581fdae9436f311..fd934a4f929ced1782d2ecc4b5feaa6a171c2d60 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1381,7 +1381,7 @@ pyElectra==1.2.4 pyRFXtrx==0.31.1 # homeassistant.components.tibber -pyTibber==0.28.2 +pyTibber==0.30.1 # homeassistant.components.dlink pyW215==0.7.0 diff --git a/script/licenses.py b/script/licenses.py index 7bcbfb6179a2feb3ffe66070b124b936ba72f6d5..ac9a836396c4ed9068f0a890ed1dd4d731d5d7de 100644 --- a/script/licenses.py +++ b/script/licenses.py @@ -154,7 +154,6 @@ EXCEPTIONS = { "nsw-fuel-api-client", # https://github.com/nickw444/nsw-fuel-api-client/pull/14 "pigpio", # https://github.com/joan2937/pigpio/pull/608 "pymitv", # MIT - "pyTibber", # https://github.com/Danielhiversen/pyTibber/pull/294 "pybbox", # https://github.com/HydrelioxGitHub/pybbox/pull/5 "pyeconet", # https://github.com/w1ll1am23/pyeconet/pull/41 "pysabnzbd", # https://github.com/jeradM/pysabnzbd/pull/6 diff --git a/tests/components/tibber/test_config_flow.py b/tests/components/tibber/test_config_flow.py index 28b590a29d2407d23217caca9fd80e8b50953bd7..0c12c4a247b669c007ada6bc8ca315af92d79538 100644 --- a/tests/components/tibber/test_config_flow.py +++ b/tests/components/tibber/test_config_flow.py @@ -5,7 +5,11 @@ from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch from aiohttp import ClientError import pytest -from tibber import FatalHttpException, InvalidLogin, RetryableHttpException +from tibber import ( + FatalHttpExceptionError, + InvalidLoginError, + RetryableHttpExceptionError, +) from homeassistant import config_entries from homeassistant.components.recorder import Recorder @@ -66,9 +70,9 @@ async def test_create_entry(recorder_mock: Recorder, hass: HomeAssistant) -> Non [ (TimeoutError, ERR_TIMEOUT), (ClientError, ERR_CLIENT), - (InvalidLogin(401), ERR_TOKEN), - (RetryableHttpException(503), ERR_CLIENT), - (FatalHttpException(404), ERR_CLIENT), + (InvalidLoginError(401), ERR_TOKEN), + (RetryableHttpExceptionError(503), ERR_CLIENT), + (FatalHttpExceptionError(404), ERR_CLIENT), ], ) async def test_create_entry_exceptions(