test_woox_r4028_powerstrip.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. def setUp(self):
  19. self.setUpForConfig("woox_r4028_powerstrip.yaml", WOOX_R4028_SOCKET_PAYLOAD)
  20. self.setUpMultiSwitch(
  21. [
  22. {
  23. "dps": SWITCH1_DPS,
  24. "name": "switch_outlet_1",
  25. "device_class": SwitchDeviceClass.OUTLET,
  26. },
  27. {
  28. "dps": SWITCH2_DPS,
  29. "name": "switch_outlet_2",
  30. "device_class": SwitchDeviceClass.OUTLET,
  31. },
  32. {
  33. "dps": SWITCH3_DPS,
  34. "name": "switch_outlet_3",
  35. "device_class": SwitchDeviceClass.OUTLET,
  36. },
  37. {
  38. "dps": SWITCHUSB_DPS,
  39. "name": "switch_usb_switch",
  40. "device_class": SwitchDeviceClass.SWITCH,
  41. },
  42. ]
  43. )
  44. self.mark_secondary(
  45. [
  46. "time_timer_1",
  47. "time_timer_2",
  48. "time_timer_3",
  49. "time_timer_usb",
  50. ]
  51. )