From 5bcfd2035f2e20c376b1af57026aa3a37cdfc3f6 Mon Sep 17 00:00:00 2001 From: coreywillwhat <104224685+coreywillwhat@users.noreply.github.com> Date: Thu, 25 Jul 2024 22:22:25 -0600 Subject: [PATCH] fix: Disable Services w/ 404 Error (#453) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .../audiconnect/audi_connect_account.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e69abce8..8f879e69 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -32,5 +32,5 @@ Disable Debug Logging **Your Vehicle Details** Model: Year: -Type (ICE/PHEV/BEV): -Region (EU/US/CA/CN): +Type (Gas/Hybrid/Electric): +Region (EU/US/CA/CN): diff --git a/custom_components/audiconnect/audi_connect_account.py b/custom_components/audiconnect/audi_connect_account.py index 3c57122b..c70f5ee1 100644 --- a/custom_components/audiconnect/audi_connect_account.py +++ b/custom_components/audiconnect/audi_connect_account.py @@ -183,7 +183,7 @@ async def refresh_vehicle_data(self, vin: str): ) return False except ClientResponseError as cre: - if cre.status in (403, 502): + if cre.status in (403, 404): _LOGGER.debug( "ClientResponseError with status %s while refreshing vehicle data for VIN: %s. Disabling refresh vehicle data support.", cre.status, @@ -562,7 +562,7 @@ async def update_vehicle_statusreport(self): except TimeoutError: raise except ClientResponseError as resp_exception: - if resp_exception.status in (403, 502): + if resp_exception.status in (403, 404): self.support_status_report = False else: self.log_exception_once( @@ -656,7 +656,7 @@ async def update_vehicle_position(self): ) raise except ClientResponseError as cre: - if cre.status in (403, 502): + if cre.status in (403, 404): _LOGGER.error( "POSITION: ClientResponseError with status %s for VIN: %s. Disabling vehicle position support.", cre.status, @@ -749,9 +749,9 @@ async def update_vehicle_climater(self): ) raise except ClientResponseError as cre: - if cre.status in (403, 502): + if cre.status in (403, 404): _LOGGER.debug( - "ClientResponseError with status %s while updating climater for VIN: %s. Disabling climater support.", + "CLIMATER: ClientResponseError with status %s while updating climater for VIN: %s. Disabling climater support.", cre.status, redacted_vin, ) @@ -791,7 +791,7 @@ async def update_vehicle_preheater(self): except TimeoutError: raise except ClientResponseError as resp_exception: - if resp_exception.status == 403 or resp_exception.status == 502: + if resp_exception.status in (403, 404): # _LOGGER.error( # "support_preheater set to False: {status}".format( # status=resp_exception.status @@ -891,7 +891,7 @@ async def update_vehicle_charger(self): except TimeoutError: raise except ClientResponseError as resp_exception: - if resp_exception.status == 403 or resp_exception.status == 502: + if resp_exception.status in (403, 404): # _LOGGER.error( # "support_charger set to False: {status}".format( # status=resp_exception.status @@ -963,7 +963,7 @@ async def update_vehicle_tripdata(self, kind: str): ) raise except ClientResponseError as cre: - if cre.status in (403, 502): + if cre.status in (403, 404): _LOGGER.debug( "ClientResponseError with status %s while updating trip data for VIN: %s. Disabling trip data support.", cre.status,