From 13e596fb80228d817681f31b349c5373ba39dd89 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 6 Jul 2024 00:22:45 +0200 Subject: [PATCH] Bump hass client to 1.2.0 (#1452) --- music_assistant/server/providers/hass/__init__.py | 12 +++++++++++- music_assistant/server/providers/hass/manifest.json | 8 ++------ requirements_all.txt | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/music_assistant/server/providers/hass/__init__.py b/music_assistant/server/providers/hass/__init__.py index 113599acf..8f9de96cf 100644 --- a/music_assistant/server/providers/hass/__init__.py +++ b/music_assistant/server/providers/hass/__init__.py @@ -42,6 +42,7 @@ CONF_URL = "url" CONF_AUTH_TOKEN = "token" CONF_ACTION_AUTH = "auth" +CONF_VERIFY_SSL = "verify_ssl" async def setup( @@ -147,6 +148,15 @@ async def get_config_entries( value=values.get(CONF_AUTH_TOKEN) if values else None, category="advanced", ), + ConfigEntry( + key=CONF_VERIFY_SSL, + type=ConfigEntryType.BOOLEAN, + label="Verify SSL", + required=False, + description="Whether or not to verify the certificate of SSL/TLS connections.", + category="advanced", + default_value=True, + ), ) @@ -163,7 +173,7 @@ async def handle_async_init(self) -> None: logging.getLogger("hass_client").setLevel(self.logger.level + 10) self.hass = HomeAssistantClient(url, token, self.mass.http_session) try: - await self.hass.connect() + await self.hass.connect(ssl=bool(self.config.get_value(CONF_VERIFY_SSL))) except BaseHassClientError as err: err_msg = str(err) or err.__class__.__name__ raise SetupFailedError(err_msg) from err diff --git a/music_assistant/server/providers/hass/manifest.json b/music_assistant/server/providers/hass/manifest.json index c3d59a6c0..6e25489ee 100644 --- a/music_assistant/server/providers/hass/manifest.json +++ b/music_assistant/server/providers/hass/manifest.json @@ -3,15 +3,11 @@ "domain": "hass", "name": "Home Assistant", "description": "Connect Music Assistant to Home Assistant.", - "codeowners": [ - "@music-assistant" - ], + "codeowners": ["@music-assistant"], "documentation": "", "multi_instance": false, "builtin": false, "load_by_default": false, "icon": "md:webhook", - "requirements": [ - "hass-client==1.1.1" - ] + "requirements": ["hass-client==1.2.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index bc04af4be..75b777ec7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -19,7 +19,7 @@ defusedxml==0.7.1 eyeD3==0.9.7 faust-cchardet>=2.1.18 git+https://github.com/coletdjnz/yt-dlp-youtube-oauth2.git -hass-client==1.1.1 +hass-client==1.2.0 ifaddr==0.2.0 mashumaro==3.13.1 memory-tempfile==2.2.3