Explorar o código

maint: allow buttons to be either config or diagnostic

Issue #4020
Jason Rumney hai 2 meses
pai
achega
00463ff5e7
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      tests/devices/base_device_tests.py

+ 6 - 0
tests/devices/base_device_tests.py

@@ -124,6 +124,12 @@ class TuyaDeviceTestCase(IsolatedAsyncioTestCase):
                         EntityCategory.DIAGNOSTIC,
                         msg=f"{k} is {e.entity_category.value}, expected diagnostic",
                     )
+                elif type(e) is TuyaLocalButton:
+                    self.assertIn(
+                        e.entity_category,
+                        [EntityCategory.CONFIG, EntityCategory.DIAGNOSTIC],
+                        msg=f"{k} is unsupported {e.entity_category.value}",
+                    )
                 else:
                     self.assertEqual(
                         e.entity_category,