diff --git a/homeassistant/components/verisure/coordinator.py b/homeassistant/components/verisure/coordinator.py index 3779af4fd16e8d..f31d36aa2da2e2 100644 --- a/homeassistant/components/verisure/coordinator.py +++ b/homeassistant/components/verisure/coordinator.py @@ -47,7 +47,7 @@ async def async_login(self) -> bool: try: await self.hass.async_add_executor_job(self.verisure.login_cookie) except VerisureLoginError as ex: - LOGGER.error("Could not log in to verisure, %s", ex) + LOGGER.error("Credentials expired for Verisure, %s", ex) raise ConfigEntryAuthFailed("Credentials expired for Verisure") from ex except VerisureError as ex: LOGGER.error("Could not log in to verisure, %s", ex) @@ -63,8 +63,16 @@ async def _async_update_data(self) -> dict: """Fetch data from Verisure.""" try: await self.hass.async_add_executor_job(self.verisure.update_cookie) - except VerisureLoginError as ex: - raise ConfigEntryAuthFailed("Credentials expired for Verisure") from ex + except VerisureLoginError: + LOGGER.debug("Cookie expired, acquiring new cookies") + try: + await self.hass.async_add_executor_job(self.verisure.login_cookie) + except VerisureLoginError as ex: + LOGGER.error("Credentials expired for Verisure, %s", ex) + raise ConfigEntryAuthFailed("Credentials expired for Verisure") from ex + except VerisureError as ex: + LOGGER.error("Could not log in to verisure, %s", ex) + raise ConfigEntryAuthFailed("Could not log in to verisure") from ex except VerisureError as ex: raise UpdateFailed("Unable to update cookie") from ex try: diff --git a/homeassistant/components/verisure/manifest.json b/homeassistant/components/verisure/manifest.json index 98440f67e4c388..7c9e7057b0cfa6 100644 --- a/homeassistant/components/verisure/manifest.json +++ b/homeassistant/components/verisure/manifest.json @@ -12,5 +12,5 @@ "integration_type": "hub", "iot_class": "cloud_polling", "loggers": ["verisure"], - "requirements": ["vsure==2.6.4"] + "requirements": ["vsure==2.6.6"] } diff --git a/requirements_all.txt b/requirements_all.txt index dd7805741a2730..2aaba30788ba15 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2647,7 +2647,7 @@ volkszaehler==0.4.0 volvooncall==0.10.3 # homeassistant.components.verisure -vsure==2.6.4 +vsure==2.6.6 # homeassistant.components.vasttrafik vtjp==0.1.14 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 6433987c4d4abb..752e320aa93826 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1941,7 +1941,7 @@ voip-utils==0.1.0 volvooncall==0.10.3 # homeassistant.components.verisure -vsure==2.6.4 +vsure==2.6.6 # homeassistant.components.vulcan vulcan-api==2.3.0