|
|
@@ -17,15 +17,15 @@ from .base_device_tests import TuyaDeviceTestCase
|
|
|
|
|
|
POWER_DPS = "1"
|
|
|
SWITCH_DPS = "2"
|
|
|
-STATUS_DPS = "3"
|
|
|
+COMMAND_DPS = "3"
|
|
|
DIRECTION_DPS = "4"
|
|
|
-UNKNOWN5_DPS = "5"
|
|
|
+STATUS_DPS = "5"
|
|
|
BATTERY_DPS = "6"
|
|
|
LOCATE_DPS = "13"
|
|
|
AREA_DPS = "16"
|
|
|
TIME_DPS = "17"
|
|
|
ERROR_DPS = "18"
|
|
|
-UNKNOWN101_DPS = "101"
|
|
|
+FAN_DPS = "101"
|
|
|
UNKNOWN102_DPS = "102"
|
|
|
UNKNOWN103_DPS = "103"
|
|
|
UNKNOWN104_DPS = "104"
|
|
|
@@ -70,6 +70,7 @@ class TestLefantM213Vacuum(MultiSensorTests, TuyaDeviceTestCase):
|
|
|
| VacuumEntityFeature.LOCATE
|
|
|
| VacuumEntityFeature.RETURN_HOME
|
|
|
| VacuumEntityFeature.CLEAN_SPOT
|
|
|
+ | VacuumEntityFeature.FAN_SPEED
|
|
|
),
|
|
|
)
|
|
|
|
|
|
@@ -77,29 +78,41 @@ class TestLefantM213Vacuum(MultiSensorTests, TuyaDeviceTestCase):
|
|
|
self.dps[BATTERY_DPS] = 50
|
|
|
self.assertEqual(self.subject.battery_level, 50)
|
|
|
|
|
|
+ def test_fan_speed(self):
|
|
|
+ self.dps[FAN_DPS] = "low"
|
|
|
+ self.assertEqual(self.subject.fan_speed, "Low")
|
|
|
+ self.dps[FAN_DPS] = "nar"
|
|
|
+ self.assertEqual(self.subject.fan_speed, "Medium")
|
|
|
+ self.dps[FAN_DPS] = "high"
|
|
|
+ self.assertEqual(self.subject.fan_speed, "High")
|
|
|
+
|
|
|
def test_status(self):
|
|
|
- self.dps[STATUS_DPS] = "standby"
|
|
|
- self.assertEqual(self.subject.status, "standby")
|
|
|
- self.dps[STATUS_DPS] = "smart"
|
|
|
+ self.dps[STATUS_DPS] = "0"
|
|
|
+ self.assertEqual(self.subject.status, "paused")
|
|
|
+ self.dps[STATUS_DPS] = "1"
|
|
|
self.assertEqual(self.subject.status, "smart")
|
|
|
- self.dps[STATUS_DPS] = "chargego"
|
|
|
- self.assertEqual(self.subject.status, "return_to_base")
|
|
|
- self.dps[STATUS_DPS] = "random"
|
|
|
+ self.dps[STATUS_DPS] = "2"
|
|
|
+ self.assertEqual(self.subject.status, "wall follow")
|
|
|
+ self.dps[STATUS_DPS] = "3"
|
|
|
+ self.assertEqual(self.subject.status, "spiral")
|
|
|
+ self.dps[STATUS_DPS] = "4"
|
|
|
+ self.assertEqual(self.subject.status, "returning")
|
|
|
+ self.dps[STATUS_DPS] = "5"
|
|
|
+ self.assertEqual(self.subject.status, "charging")
|
|
|
+ self.dps[STATUS_DPS] = "6"
|
|
|
self.assertEqual(self.subject.status, "random")
|
|
|
- self.dps[STATUS_DPS] = "wall_follow"
|
|
|
- self.assertEqual(self.subject.status, "wall_follow")
|
|
|
- self.dps[STATUS_DPS] = "spiral"
|
|
|
- self.assertEqual(self.subject.status, "clean_spot")
|
|
|
+ self.dps[STATUS_DPS] = "7"
|
|
|
+ self.assertEqual(self.subject.status, "standby")
|
|
|
|
|
|
def test_state(self):
|
|
|
self.dps[POWER_DPS] = True
|
|
|
self.dps[SWITCH_DPS] = True
|
|
|
self.dps[ERROR_DPS] = 0
|
|
|
- self.dps[STATUS_DPS] = "return_to_base"
|
|
|
+ self.dps[STATUS_DPS] = "4"
|
|
|
self.assertEqual(self.subject.state, STATE_RETURNING)
|
|
|
- self.dps[STATUS_DPS] = "standby"
|
|
|
+ self.dps[STATUS_DPS] = "7"
|
|
|
self.assertEqual(self.subject.state, STATE_DOCKED)
|
|
|
- self.dps[STATUS_DPS] = "random"
|
|
|
+ self.dps[STATUS_DPS] = "6"
|
|
|
self.assertEqual(self.subject.state, STATE_CLEANING)
|
|
|
self.dps[POWER_DPS] = False
|
|
|
self.assertEqual(self.subject.state, STATE_DOCKED)
|
|
|
@@ -148,14 +161,14 @@ class TestLefantM213Vacuum(MultiSensorTests, TuyaDeviceTestCase):
|
|
|
async def test_async_return_to_base(self):
|
|
|
async with assert_device_properties_set(
|
|
|
self.subject._device,
|
|
|
- {STATUS_DPS: "chargego"},
|
|
|
+ {COMMAND_DPS: "chargego"},
|
|
|
):
|
|
|
await self.subject.async_return_to_base()
|
|
|
|
|
|
async def test_async_clean_spot(self):
|
|
|
async with assert_device_properties_set(
|
|
|
self.subject._device,
|
|
|
- {STATUS_DPS: "spiral"},
|
|
|
+ {COMMAND_DPS: "spiral"},
|
|
|
):
|
|
|
await self.subject.async_clean_spot()
|
|
|
|
|
|
@@ -169,28 +182,28 @@ class TestLefantM213Vacuum(MultiSensorTests, TuyaDeviceTestCase):
|
|
|
async def test_async_send_standby_command(self):
|
|
|
async with assert_device_properties_set(
|
|
|
self.subject._device,
|
|
|
- {STATUS_DPS: "standby"},
|
|
|
+ {COMMAND_DPS: "standby"},
|
|
|
):
|
|
|
await self.subject.async_send_command("standby")
|
|
|
|
|
|
async def test_async_send_smart_command(self):
|
|
|
async with assert_device_properties_set(
|
|
|
self.subject._device,
|
|
|
- {STATUS_DPS: "smart"},
|
|
|
+ {COMMAND_DPS: "smart"},
|
|
|
):
|
|
|
await self.subject.async_send_command("smart")
|
|
|
|
|
|
async def test_async_send_random_command(self):
|
|
|
async with assert_device_properties_set(
|
|
|
self.subject._device,
|
|
|
- {STATUS_DPS: "random"},
|
|
|
+ {COMMAND_DPS: "random"},
|
|
|
):
|
|
|
await self.subject.async_send_command("random")
|
|
|
|
|
|
async def test_async_send_wall_follow_command(self):
|
|
|
async with assert_device_properties_set(
|
|
|
self.subject._device,
|
|
|
- {STATUS_DPS: "wall_follow"},
|
|
|
+ {COMMAND_DPS: "wall_follow"},
|
|
|
):
|
|
|
await self.subject.async_send_command("wall_follow")
|
|
|
|