test_logicom_powerstrip.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. """Tests for the Logicom Strippy 4-way+USB powerstrip."""
  2. from homeassistant.components.switch import SwitchDeviceClass
  3. from ..const import LOGICOM_STRIPPY_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. SWITCH4_DPS = "4"
  10. SWITCHUSB_DPS = "5"
  11. TIMER1_DPS = "9"
  12. TIMER2_DPS = "10"
  13. TIMER3_DPS = "11"
  14. TIMER4_DPS = "12"
  15. TIMERUSB_DPS = "13"
  16. class TestLogicomPowerstrip(
  17. MultiSwitchTests,
  18. TuyaDeviceTestCase,
  19. ):
  20. def setUp(self):
  21. self.setUpForConfig("logicom_powerstrip.yaml", LOGICOM_STRIPPY_PAYLOAD)
  22. self.setUpMultiSwitch(
  23. [
  24. {
  25. "dps": SWITCH1_DPS,
  26. "name": "switch_outlet_1",
  27. "device_class": SwitchDeviceClass.OUTLET,
  28. },
  29. {
  30. "dps": SWITCH2_DPS,
  31. "name": "switch_outlet_2",
  32. "device_class": SwitchDeviceClass.OUTLET,
  33. },
  34. {
  35. "dps": SWITCH3_DPS,
  36. "name": "switch_outlet_3",
  37. "device_class": SwitchDeviceClass.OUTLET,
  38. },
  39. {
  40. "dps": SWITCH4_DPS,
  41. "name": "switch_outlet_4",
  42. "device_class": SwitchDeviceClass.OUTLET,
  43. },
  44. {
  45. "dps": SWITCHUSB_DPS,
  46. "name": "switch_usb_switch",
  47. "device_class": SwitchDeviceClass.SWITCH,
  48. },
  49. ]
  50. )
  51. self.mark_secondary(
  52. [
  53. "time_timer_1",
  54. "time_timer_2",
  55. "time_timer_3",
  56. "time_timer_4",
  57. "time_timer_usb",
  58. ]
  59. )