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, ):