From e8c6e9f0ade7a94e8cf253e233b1d9accde1529a Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 7 Feb 2025 17:28:59 -0600 Subject: [PATCH] fix: use new max_ws_message_size, remove from RESTConnector --- ovos_PHAL_plugin_homeassistant/__init__.py | 1 - ovos_PHAL_plugin_homeassistant/logic/connector.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ovos_PHAL_plugin_homeassistant/__init__.py b/ovos_PHAL_plugin_homeassistant/__init__.py index 64f5630..91c5753 100644 --- a/ovos_PHAL_plugin_homeassistant/__init__.py +++ b/ovos_PHAL_plugin_homeassistant/__init__.py @@ -261,7 +261,6 @@ def init_configuration(self, message=None): configuration_host, configuration_api_key, configuration_assist_only, - self.max_ws_message_size ) self.devices = self.connector.get_all_devices() self.registered_devices = [] diff --git a/ovos_PHAL_plugin_homeassistant/logic/connector.py b/ovos_PHAL_plugin_homeassistant/logic/connector.py index 705286d..3f6b6a1 100644 --- a/ovos_PHAL_plugin_homeassistant/logic/connector.py +++ b/ovos_PHAL_plugin_homeassistant/logic/connector.py @@ -308,11 +308,11 @@ def send_assist_command(self, command, arguments={}): class HomeAssistantWSConnector(HomeAssistantConnector): - def __init__(self, host, api_key, assist_only=True): + def __init__(self, host, api_key, assist_only=True, max_ws_message_size=5242880): super().__init__(host, api_key, assist_only) if self.host.startswith("http"): self.host.replace("http", "ws", 1) - self._connection = HomeAssistantClient(self.host, self.api_key) + self._connection = HomeAssistantClient(url=self.host, token=self.api_key, max_ws_message_size=max_ws_message_size) self._connection.connect() # Initialize client instance