From afc2408c82802c44e051e8c7d15a763e1a8969f4 Mon Sep 17 00:00:00 2001 From: Geoff Franks Date: Mon, 16 Mar 2026 09:11:17 -0400 Subject: [PATCH] Attempt to fix 2026.1 incompatibility --- custom_components/generac/config_flow.py | 9 ++++----- custom_components/generac/models.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/custom_components/generac/config_flow.py b/custom_components/generac/config_flow.py index 1b2ff40..78a3c49 100644 --- a/custom_components/generac/config_flow.py +++ b/custom_components/generac/config_flow.py @@ -24,7 +24,6 @@ class GeneracFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Config flow for generac.""" VERSION = 1 - CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL def __init__(self): """Initialize.""" @@ -134,11 +133,11 @@ async def _test_credentials(self, username, password, session_cookie): client = GeneracApiClient(session, username, password, session_cookie) await client.async_get_data() return None - except InvalidCredentialsException as e: # pylint: disable=broad-except - _LOGGER.debug("ERROR in testing credentials: %s", e) + except InvalidCredentialsException as e: + _LOGGER.error("Invalid credentials: %s", e) return "auth" - except Exception as e: # pylint: disable=broad-except - _LOGGER.debug("ERROR: %s", e) + except Exception as e: + _LOGGER.error("Unexpected error testing credentials: %s", e, exc_info=True) return "internal" diff --git a/custom_components/generac/models.py b/custom_components/generac/models.py index 28ff6b3..d66b6aa 100644 --- a/custom_components/generac/models.py +++ b/custom_components/generac/models.py @@ -107,7 +107,7 @@ class Property: @dataclass class Value: type: Optional[int] - status: Optional[int] | Optional[str] + status: Optional[int | str] isLegacy: Optional[bool] isRunning: Optional[bool] deviceId: Optional[str]