From ae5a122e048af62d67bf350f80f8e93d0fb11b1b Mon Sep 17 00:00:00 2001 From: bigshow104 <82096625+bigshow104@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:10:00 +0000 Subject: [PATCH 1/2] Fix reauthentication when Hive device authentication expires --- custom_components/hive/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/hive/__init__.py b/custom_components/hive/__init__.py index 071b7c7..61df063 100755 --- a/custom_components/hive/__init__.py +++ b/custom_components/hive/__init__.py @@ -11,6 +11,7 @@ from apyhiveapi import Auth, Hive from apyhiveapi.helper.hive_exceptions import ( HiveConnectionError, + HiveInvalidDeviceAuthentication, HiveReauthRequired, HiveUnknownConfiguration, ) @@ -50,7 +51,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: HiveConfigEntry) -> bool except HiveConnectionError as error: _LOGGER.error("Could not fetch devices from Hive: %s", error) raise ConfigEntryNotReady from error - except (HiveReauthRequired, HiveUnknownConfiguration) as err: + except (HiveReauthRequired, HiveUnknownConfiguration, HiveInvalidDeviceAuthentication) as err: raise ConfigEntryAuthFailed from err device_registry = dr.async_get(hass) From ebdf55f166c89d919a588c8fb0599a2f5c052baa Mon Sep 17 00:00:00 2001 From: bigshow104 <82096625+bigshow104@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:18:26 +0000 Subject: [PATCH 2/2] Format Hive authentication exception handler --- custom_components/hive/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/custom_components/hive/__init__.py b/custom_components/hive/__init__.py index 61df063..749b263 100755 --- a/custom_components/hive/__init__.py +++ b/custom_components/hive/__init__.py @@ -51,8 +51,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: HiveConfigEntry) -> bool except HiveConnectionError as error: _LOGGER.error("Could not fetch devices from Hive: %s", error) raise ConfigEntryNotReady from error - except (HiveReauthRequired, HiveUnknownConfiguration, HiveInvalidDeviceAuthentication) as err: - raise ConfigEntryAuthFailed from err + except ( + HiveReauthRequired, + HiveUnknownConfiguration, + HiveInvalidDeviceAuthentication, + ) as err: device_registry = dr.async_get(hass) device_registry.async_get_or_create(