Przeglądaj źródła

maint: allow buttons to be either config or diagnostic

Issue #4020
Jason Rumney 2 miesięcy temu
rodzic
commit
00463ff5e7
1 zmienionych plików z 6 dodań i 0 usunięć
  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,