From 292a97e33b457658005d3f2c630970fd5ad8b8d0 Mon Sep 17 00:00:00 2001 From: ia74 <68617740+ia74@users.noreply.github.com> Date: Sat, 9 Aug 2025 01:19:07 -0500 Subject: [PATCH] improt decode erorr --- custom_components/roomba_rest980/CloudApi.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/roomba_rest980/CloudApi.py b/custom_components/roomba_rest980/CloudApi.py index ad034ad..747ea2e 100644 --- a/custom_components/roomba_rest980/CloudApi.py +++ b/custom_components/roomba_rest980/CloudApi.py @@ -14,6 +14,8 @@ from typing import Any import urllib.parse import uuid +from json.decoder import JSONDecodeError + import aiohttp _LOGGER = logging.getLogger(__name__) @@ -230,7 +232,7 @@ class iRobotCloudApi: try: login_result = json.loads(response_text) - except json.JSONDecodeError as e: + except JSONDecodeError as e: raise AuthenticationError( f"Invalid JSON response from Gigya login: {response_text}" ) from e @@ -328,7 +330,7 @@ class iRobotCloudApi: try: login_result = json.loads(response_text) - except json.JSONDecodeError as e: + except JSONDecodeError as e: raise AuthenticationError( f"Invalid JSON response from iRobot login: {response_text}" ) from e @@ -526,7 +528,7 @@ class iRobotCloudApi: existing_data = json.loads(content) if not isinstance(existing_data, list): existing_data = [existing_data] - except (json.JSONDecodeError, OSError): + except (JSONDecodeError, OSError): existing_data = [] # Add new data