test_woox_r4028_powerstrip.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. """Tests for the Woox R4028 powerstrip."""
  2. from homeassistant.components.switch import SwitchDeviceClass
  3. from ..const import WOOX_R4028_SOCKET_PAYLOAD
  4. from ..mixins.switch import MultiSwitchTests
  5. from .base_device_tests import TuyaDeviceTestCase
  6. SWITCH1_DPS = "1"
  7. SWITCH2_DPS = "2"
  8. SWITCH3_DPS = "3"
  9. SWITCHUSB_DPS = "7"
  10. TIMER1_DPS = "101"
  11. TIMER2_DPS = "102"
  12. TIMER3_DPS = "103"
  13. TIMERUSB_DPS = "105"
  14. class TestWooxR4028Powerstrip(
  15. MultiSwitchTests,
  16. TuyaDeviceTestCase,
  17. ):
  18. __test__ = True
  19. def setUp(self):
  20. self.setUpForConfig("woox_r4028_powerstrip.yaml", WOOX_R4028_SOCKET_PAYLOAD)
  21. self.setUpMultiSwitch(
  22. [
  23. {
  24. "dps": SWITCH1_DPS,
  25. "name": "switch_outlet_1",
  26. "device_class": SwitchDeviceClass.OUTLET,
  27. },
  28. {
  29. "dps": SWITCH2_DPS,
  30. "name": "switch_outlet_2",
  31. "device_class": SwitchDeviceClass.OUTLET,
  32. },
  33. {
  34. "dps": SWITCH3_DPS,
  35. "name": "switch_outlet_3",
  36. "device_class": SwitchDeviceClass.OUTLET,
  37. },
  38. {
  39. "dps": SWITCHUSB_DPS,
  40. "name": "switch_usb_switch",
  41. "device_class": SwitchDeviceClass.SWITCH,
  42. },
  43. ]
  44. )
  45. self.mark_secondary(
  46. [
  47. "time_timer_1",
  48. "time_timer_2",
  49. "time_timer_3",
  50. "time_timer_usb",
  51. ]
  52. )