mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 11:29:46 +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(
|
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:
|
||||||
|
|||||||
@@ -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,
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user