From 805a03dfd2bcb6d6e76f5af219c417bb61b14ff3 Mon Sep 17 00:00:00 2001 From: cdnninja Date: Sat, 8 Nov 2025 06:31:50 -0700 Subject: [PATCH] update methods to non deprecated methods in vesync (#155887) --- homeassistant/components/vesync/humidifier.py | 2 +- tests/components/vesync/test_humidifier.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/vesync/humidifier.py b/homeassistant/components/vesync/humidifier.py index 6a6400d74af..5d70b5d8f9a 100644 --- a/homeassistant/components/vesync/humidifier.py +++ b/homeassistant/components/vesync/humidifier.py @@ -159,7 +159,7 @@ class VeSyncHumidifierHA(VeSyncBaseEntity, HumidifierEntity): raise HomeAssistantError( f"Invalid mode {mode}. Available modes: {self.available_modes}" ) - if not await self.device.set_humidity_mode(self._get_vs_mode(mode)): + if not await self.device.set_mode(self._get_vs_mode(mode)): raise HomeAssistantError(self.device.last_response.message) if mode == MODE_SLEEP: diff --git a/tests/components/vesync/test_humidifier.py b/tests/components/vesync/test_humidifier.py index a6aa63643b8..3d4400ecdbc 100644 --- a/tests/components/vesync/test_humidifier.py +++ b/tests/components/vesync/test_humidifier.py @@ -239,7 +239,7 @@ async def test_set_mode_invalid( """Test handling of invalid value in set_mode method.""" with patch( - "pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_humidity_mode" + "pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_mode" ) as method_mock: with pytest.raises(HomeAssistantError): await hass.services.async_call( @@ -268,7 +268,7 @@ async def test_set_mode( with ( expectation, patch( - "pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_humidity_mode", + "pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_mode", return_value=api_response, ) as method_mock, ):