update methods to non deprecated methods in vesync (#155887)

This commit is contained in:
cdnninja
2025-11-08 06:31:50 -07:00
committed by GitHub
parent 99bf3a6c6a
commit 805a03dfd2
2 changed files with 3 additions and 3 deletions

View File

@@ -159,7 +159,7 @@ class VeSyncHumidifierHA(VeSyncBaseEntity, HumidifierEntity):
raise HomeAssistantError( raise HomeAssistantError(
f"Invalid mode {mode}. Available modes: {self.available_modes}" 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) raise HomeAssistantError(self.device.last_response.message)
if mode == MODE_SLEEP: if mode == MODE_SLEEP:

View File

@@ -239,7 +239,7 @@ async def test_set_mode_invalid(
"""Test handling of invalid value in set_mode method.""" """Test handling of invalid value in set_mode method."""
with patch( with patch(
"pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_humidity_mode" "pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_mode"
) as method_mock: ) as method_mock:
with pytest.raises(HomeAssistantError): with pytest.raises(HomeAssistantError):
await hass.services.async_call( await hass.services.async_call(
@@ -268,7 +268,7 @@ async def test_set_mode(
with ( with (
expectation, expectation,
patch( patch(
"pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_humidity_mode", "pyvesync.devices.vesynchumidifier.VeSyncHumid200300S.set_mode",
return_value=api_response, return_value=api_response,
) as method_mock, ) as method_mock,
): ):