Explorar o código

Tests: RGBCW lightbulb has an additional Do not disturb switch

Since the python tests do not run unless there are python changes, this
was previously missed. It also affects the test_available result, as the
default implementation assumes all entities are available.
Jason Rumney hai 11 meses
pai
achega
54aa6dc580
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      tests/devices/test_rgbcw_lightbulb.py

+ 12 - 1
tests/devices/test_rgbcw_lightbulb.py

@@ -41,7 +41,14 @@ class TestRGBCWLightbulb(BasicNumberTests, BasicTextTests, TuyaDeviceTestCase):
             self.entities.get("text_scene"),
             pattern=TEXT_PATTERN_HEX,
         )
-        self.mark_secondary(["number_timer", "select_scene", "text_scene"])
+        self.mark_secondary(
+            [
+                "number_timer",
+                "select_scene",
+                "text_scene",
+                "switch_do_not_disturb",
+            ]
+        )
 
     def test_is_on(self):
         self.dps[SWITCH_DPS] = True
@@ -183,6 +190,10 @@ class TestRGBCWLightbulb(BasicNumberTests, BasicTextTests, TuyaDeviceTestCase):
                 hs_color=(0, 100),
             )
 
+    def test_available(self):
+        self.assertFalse(self.entities.get("switch_do_not_disturb").available)
+        self.assertTrue(self.subject.available)
+
     def test_disabled_by_default(self):
         self.assertFalse(self.basicText.entity_registry_enabled_default)
         self.assertTrue(self.subject.entity_registry_enabled_default)