From 647723d3f0a2b74aedc33b2c835b54c8f7f22270 Mon Sep 17 00:00:00 2001 From: cdnninja Date: Sun, 5 Oct 2025 00:56:25 -0600 Subject: [PATCH] Bump pyvesync to 3.1.0 (#153693) --- homeassistant/components/vesync/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/vesync/conftest.py | 31 +++++++++++++++++-- .../vesync/snapshots/test_diagnostics.ambr | 2 -- 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/vesync/manifest.json b/homeassistant/components/vesync/manifest.json index 6ea7edd13d51..8749dd956ff0 100644 --- a/homeassistant/components/vesync/manifest.json +++ b/homeassistant/components/vesync/manifest.json @@ -13,5 +13,5 @@ "documentation": "https://www.home-assistant.io/integrations/vesync", "iot_class": "cloud_polling", "loggers": ["pyvesync"], - "requirements": ["pyvesync==3.0.0"] + "requirements": ["pyvesync==3.1.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 8424ce4daf5b..520dbe294060 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2611,7 +2611,7 @@ pyvera==0.3.16 pyversasense==0.0.6 # homeassistant.components.vesync -pyvesync==3.0.0 +pyvesync==3.1.0 # homeassistant.components.vizio pyvizio==0.1.61 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 64c60b434261..eb1ba0f58e34 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2169,7 +2169,7 @@ pyuptimerobot==22.2.0 pyvera==0.3.16 # homeassistant.components.vesync -pyvesync==3.0.0 +pyvesync==3.1.0 # homeassistant.components.vizio pyvizio==0.1.61 diff --git a/tests/components/vesync/conftest.py b/tests/components/vesync/conftest.py index faaefb2ed82c..8b15e7c76d3c 100644 --- a/tests/components/vesync/conftest.py +++ b/tests/components/vesync/conftest.py @@ -10,6 +10,7 @@ from unittest.mock import AsyncMock, MagicMock, Mock, PropertyMock, patch import pytest from pyvesync import VeSync +from pyvesync.auth import VeSyncAuth from pyvesync.base_devices.bulb_base import VeSyncBulb from pyvesync.base_devices.fan_base import VeSyncFanBase from pyvesync.base_devices.humidifier_base import HumidifierState @@ -51,15 +52,12 @@ def patch_vesync(): """Patch VeSync methods and several properties/attributes for all tests.""" props = { "enabled": True, - "token": "TEST_TOKEN", - "account_id": "TEST_ACCOUNT_ID", } with ( patch.multiple( "pyvesync.vesync.VeSync", check_firmware=AsyncMock(return_value=True), - login=AsyncMock(return_value=None), ), ExitStack() as stack, ): @@ -71,6 +69,33 @@ def patch_vesync(): yield +@pytest.fixture(autouse=True) +def patch_vesync_auth(): + """Patch VeSync Auth methods and several properties/attributes for all tests.""" + props = { + "_token": "TESTTOKEN", + "_account_id": "TESTACCOUNTID", + "_country_code": "US", + "_current_region": "US", + "_username": "TESTUSERNAME", + "_password": "TESTPASSWORD", + } + + with ( + patch.multiple( + "pyvesync.auth.VeSyncAuth", + login=AsyncMock(return_value=True), + ), + ExitStack() as stack, + ): + for name, value in props.items(): + mock = stack.enter_context( + patch.object(VeSyncAuth, name, new_callable=PropertyMock) + ) + mock.return_value = value + yield + + @pytest.fixture(name="config_entry") def config_entry_fixture(hass: HomeAssistant, config) -> ConfigEntry: """Create a mock VeSync config entry.""" diff --git a/tests/components/vesync/snapshots/test_diagnostics.ambr b/tests/components/vesync/snapshots/test_diagnostics.ambr index 7b6c8a2899d8..3f01ce765b93 100644 --- a/tests/components/vesync/snapshots/test_diagnostics.ambr +++ b/tests/components/vesync/snapshots/test_diagnostics.ambr @@ -53,7 +53,6 @@ 'device_status': 'on', 'device_type': 'Classic200S', 'display': 'Method', - 'displayJSON': 'Method', 'enabled': 'Method', 'features': list([ 'night_light', @@ -173,7 +172,6 @@ 'device_status': 'on', 'device_type': 'fan', 'display': 'Method', - 'displayJSON': 'Method', 'enabled': 'Method', 'fan_levels': 'Method', 'features': 'Method',