4
0
Эх сурвалжийг харах

Tests: Moebot - add test for button mapping

On discussion #2267, a user claims the mapping is not working.
Add a test to make sure.
Jason Rumney 11 сар өмнө
parent
commit
a53a8770d1

+ 8 - 0
tests/devices/test_moebot.py

@@ -37,6 +37,7 @@ class TestMoebot(TuyaDeviceTestCase):
     def setUp(self):
     def setUp(self):
         self.setUpForConfig("moebot_s_mower.yaml", MOEBOT_PAYLOAD)
         self.setUpForConfig("moebot_s_mower.yaml", MOEBOT_PAYLOAD)
         self.mower = self.entities.get("lawn_mower")
         self.mower = self.entities.get("lawn_mower")
+        self.start_button = self.entities.get("button_start_fixed_mowing")
         self.mark_secondary(
         self.mark_secondary(
             [
             [
                 "binary_sensor_cover",
                 "binary_sensor_cover",
@@ -90,6 +91,13 @@ class TestMoebot(TuyaDeviceTestCase):
         ):
         ):
             await self.mower.async_start_mowing()
             await self.mower.async_start_mowing()
 
 
+    async def test_async_start_fixed_mowing(self):
+        async with assert_device_properties_set(
+            self.start_button._device,
+            {COMMAND_DP: "StartFixedMowing"},
+        ):
+            await self.start_button.async_press()
+
     async def test_async_pause(self):
     async def test_async_pause(self):
         async with assert_device_properties_set(
         async with assert_device_properties_set(
             self.mower._device,
             self.mower._device,