From c1a7166edd264ec595ab81ac821fd4fe906b3a79 Mon Sep 17 00:00:00 2001 From: springstan Date: Sat, 14 Mar 2020 22:43:36 +0100 Subject: [PATCH 1/2] Fix xiaomi_miio vacuum fan speed list --- homeassistant/components/xiaomi_miio/vacuum.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/xiaomi_miio/vacuum.py b/homeassistant/components/xiaomi_miio/vacuum.py index a32a28993cac3..4efb6fe7d7169 100644 --- a/homeassistant/components/xiaomi_miio/vacuum.py +++ b/homeassistant/components/xiaomi_miio/vacuum.py @@ -60,7 +60,13 @@ extra=vol.ALLOW_EXTRA, ) -FAN_SPEEDS = {"Silent": 38, "Standard": 60, "Medium": 77, "Turbo": 90, "Gentle": 105} +FAN_SPEEDS = { + "Silent": 101, + "Standard": 102, + "Medium": 103, + "Turbo": 104, + "Gentle": 105, +} ATTR_CLEAN_START = "clean_start" ATTR_CLEAN_STOP = "clean_stop" From 870e272a56b0b39af3d3a1495fc9f015f62ba543 Mon Sep 17 00:00:00 2001 From: springstan Date: Sat, 14 Mar 2020 23:42:23 +0100 Subject: [PATCH 2/2] Fix broken test --- tests/components/xiaomi_miio/test_vacuum.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/components/xiaomi_miio/test_vacuum.py b/tests/components/xiaomi_miio/test_vacuum.py index 47c7a98023ce5..4b0eaeebfe85e 100644 --- a/tests/components/xiaomi_miio/test_vacuum.py +++ b/tests/components/xiaomi_miio/test_vacuum.py @@ -68,7 +68,7 @@ def mirobo_is_got_error_fixture(): mock_vacuum = mock.MagicMock() mock_vacuum.status().data = {"test": "raw"} mock_vacuum.status().is_on = False - mock_vacuum.status().fanspeed = 38 + mock_vacuum.status().fanspeed = 101 mock_vacuum.status().got_error = True mock_vacuum.status().error = "Error message" mock_vacuum.status().battery = 82 @@ -261,11 +261,11 @@ async def test_xiaomi_vacuum_services(hass, caplog, mock_mirobo_is_got_error): await hass.services.async_call( DOMAIN, SERVICE_SET_FAN_SPEED, - {"entity_id": entity_id, "fan_speed": 60}, + {"entity_id": entity_id, "fan_speed": 102}, blocking=True, ) mock_mirobo_is_got_error.assert_has_calls( - [mock.call.set_fan_speed(60)], any_order=True + [mock.call.set_fan_speed(102)], any_order=True ) mock_mirobo_is_got_error.assert_has_calls(STATUS_CALLS, any_order=True) mock_mirobo_is_got_error.reset_mock() @@ -277,7 +277,7 @@ async def test_xiaomi_vacuum_services(hass, caplog, mock_mirobo_is_got_error): blocking=True, ) mock_mirobo_is_got_error.assert_has_calls( - [mock.call.set_fan_speed(77)], any_order=True + [mock.call.set_fan_speed(103)], any_order=True ) mock_mirobo_is_got_error.assert_has_calls(STATUS_CALLS, any_order=True) mock_mirobo_is_got_error.reset_mock()