From 05b23c2e7b20a7d81b73b24a7385736c45e76d23 Mon Sep 17 00:00:00 2001 From: Jan Rothkegel <52739230+janrothkegel@users.noreply.github.com> Date: Wed, 21 Feb 2024 09:37:13 +0100 Subject: [PATCH] Replace Wolflink dependency with wolf_comm to support authentication via OpenID (#110249) * Add OpenID authentication to wolflink integration * Update wolf-comm to 0.0.2 * Upgrade wolf_comm to 0.0.3 + fix tests * Version 0.0.4 of wolf_comm including LICENSE.txt * Update requirements to wolf_comm 0.0.4 --------- Co-authored-by: Jan Rothkegel --- homeassistant/components/wolflink/__init__.py | 5 ++--- homeassistant/components/wolflink/config_flow.py | 4 ++-- homeassistant/components/wolflink/manifest.json | 4 ++-- homeassistant/components/wolflink/sensor.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/wolflink/test_config_flow.py | 4 ++-- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/wolflink/__init__.py b/homeassistant/components/wolflink/__init__.py index 73f49a2ad09..cf08e29698c 100644 --- a/homeassistant/components/wolflink/__init__.py +++ b/homeassistant/components/wolflink/__init__.py @@ -3,8 +3,8 @@ from datetime import timedelta import logging from httpx import RequestError -from wolf_smartset.token_auth import InvalidAuth -from wolf_smartset.wolf_client import FetchFailed, ParameterReadError, WolfClient +from wolf_comm.token_auth import InvalidAuth +from wolf_comm.wolf_client import FetchFailed, ParameterReadError, WolfClient from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform @@ -50,7 +50,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: try: nonlocal refetch_parameters nonlocal parameters - await wolf_client.update_session() if not await wolf_client.fetch_system_state_list(device_id, gateway_id): refetch_parameters = True raise UpdateFailed( diff --git a/homeassistant/components/wolflink/config_flow.py b/homeassistant/components/wolflink/config_flow.py index 63331fdbbd1..bffc742f202 100644 --- a/homeassistant/components/wolflink/config_flow.py +++ b/homeassistant/components/wolflink/config_flow.py @@ -3,8 +3,8 @@ import logging from httpcore import ConnectError import voluptuous as vol -from wolf_smartset.token_auth import InvalidAuth -from wolf_smartset.wolf_client import WolfClient +from wolf_comm.token_auth import InvalidAuth +from wolf_comm.wolf_client import WolfClient from homeassistant import config_entries from homeassistant.const import CONF_PASSWORD, CONF_USERNAME diff --git a/homeassistant/components/wolflink/manifest.json b/homeassistant/components/wolflink/manifest.json index 0d793385a3b..c9e3937e786 100644 --- a/homeassistant/components/wolflink/manifest.json +++ b/homeassistant/components/wolflink/manifest.json @@ -5,6 +5,6 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/wolflink", "iot_class": "cloud_polling", - "loggers": ["wolf_smartset"], - "requirements": ["wolf-smartset==0.1.11"] + "loggers": ["wolf_comm"], + "requirements": ["wolf-comm==0.0.4"] } diff --git a/homeassistant/components/wolflink/sensor.py b/homeassistant/components/wolflink/sensor.py index 2135239b3eb..2a030f69171 100644 --- a/homeassistant/components/wolflink/sensor.py +++ b/homeassistant/components/wolflink/sensor.py @@ -1,7 +1,7 @@ """The Wolf SmartSet sensors.""" from __future__ import annotations -from wolf_smartset.models import ( +from wolf_comm.models import ( HoursParameter, ListItemParameter, Parameter, diff --git a/requirements_all.txt b/requirements_all.txt index 3872a85c30a..ac7be69cbbe 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2856,7 +2856,7 @@ wirelesstagpy==0.8.1 wled==0.17.0 # homeassistant.components.wolflink -wolf-smartset==0.1.11 +wolf-comm==0.0.4 # homeassistant.components.wyoming wyoming==1.5.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 803768f32da..16091ace69c 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2188,7 +2188,7 @@ wiffi==1.1.2 wled==0.17.0 # homeassistant.components.wolflink -wolf-smartset==0.1.11 +wolf-comm==0.0.4 # homeassistant.components.wyoming wyoming==1.5.2 diff --git a/tests/components/wolflink/test_config_flow.py b/tests/components/wolflink/test_config_flow.py index a7d9996baaa..5be2dbf78f7 100644 --- a/tests/components/wolflink/test_config_flow.py +++ b/tests/components/wolflink/test_config_flow.py @@ -2,8 +2,8 @@ from unittest.mock import patch from httpcore import ConnectError -from wolf_smartset.models import Device -from wolf_smartset.token_auth import InvalidAuth +from wolf_comm.models import Device +from wolf_comm.token_auth import InvalidAuth from homeassistant import config_entries, data_entry_flow from homeassistant.components.wolflink.const import (