mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
update methods to non deprecated methods in vesync (#155887)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user