Răsfoiți Sursa

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 10 luni în urmă
părinte
comite
a53a8770d1
1 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 8 0
      tests/devices/test_moebot.py

+ 8 - 0
tests/devices/test_moebot.py

@@ -37,6 +37,7 @@ class TestMoebot(TuyaDeviceTestCase):
     def setUp(self):
         self.setUpForConfig("moebot_s_mower.yaml", MOEBOT_PAYLOAD)
         self.mower = self.entities.get("lawn_mower")
+        self.start_button = self.entities.get("button_start_fixed_mowing")
         self.mark_secondary(
             [
                 "binary_sensor_cover",
@@ -90,6 +91,13 @@ class TestMoebot(TuyaDeviceTestCase):
         ):
             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 with assert_device_properties_set(
             self.mower._device,