From 1fa95e0a57ca1a56e99671afdd139adba7530b14 Mon Sep 17 00:00:00 2001 From: SavageCore Date: Thu, 30 Jan 2025 16:22:06 +0000 Subject: [PATCH] Remove asyncio as it's now a standard library --- .../app/classes/homeassistant_websocket.py | 4 ++-- alexa_shopping_list_sync/app/requirements.txt | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/alexa_shopping_list_sync/app/classes/homeassistant_websocket.py b/alexa_shopping_list_sync/app/classes/homeassistant_websocket.py index 4b9d138..6ce464c 100644 --- a/alexa_shopping_list_sync/app/classes/homeassistant_websocket.py +++ b/alexa_shopping_list_sync/app/classes/homeassistant_websocket.py @@ -112,7 +112,7 @@ async def get_todo_list_items(self): ] else: raise Exception(f"Failed to get items: {response_data.get('error')}") - except websockets.ConnectionClosed as e: + except websockets.exceptions.ConnectionClosed as e: self.logger.error(f"Connection closed while fetching items: {e}") await self.connect_with_retries() # Attempt to reconnect return await self.get_todo_list_items() # Retry fetching items @@ -145,7 +145,7 @@ async def add_todo_list_item(self, item_name): response_data = json.loads(response) if response_data.get("success") is False: raise Exception(f"Failed to add item: {response_data.get('error')}") - except websockets.ConnectionClosed as e: + except websockets.exceptions.ConnectionClosed as e: self.logger.error(f"Connection closed while adding item: {e}") await self.connect_with_retries() # Attempt to reconnect await self.add_todo_list_item(item_name, id) # Retry adding the item diff --git a/alexa_shopping_list_sync/app/requirements.txt b/alexa_shopping_list_sync/app/requirements.txt index 83f6ec1..021cc19 100644 --- a/alexa_shopping_list_sync/app/requirements.txt +++ b/alexa_shopping_list_sync/app/requirements.txt @@ -3,6 +3,5 @@ black==24.10.0 pyotp===2.9.0 flask===3.1.0 hypercorn===0.17.3 -asyncio===3.4.3 websockets===14.1 apscheduler===3.10.4 \ No newline at end of file