test_logicom_powerstrip.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. __test__ = True
  21. def setUp(self):
  22. self.setUpForConfig("logicom_powerstrip.yaml", LOGICOM_STRIPPY_PAYLOAD)
  23. self.setUpMultiSwitch(
  24. [
  25. {
  26. "dps": SWITCH1_DPS,
  27. "name": "switch_outlet_1",
  28. "device_class": SwitchDeviceClass.OUTLET,
  29. },
  30. {
  31. "dps": SWITCH2_DPS,
  32. "name": "switch_outlet_2",
  33. "device_class": SwitchDeviceClass.OUTLET,
  34. },
  35. {
  36. "dps": SWITCH3_DPS,
  37. "name": "switch_outlet_3",
  38. "device_class": SwitchDeviceClass.OUTLET,
  39. },
  40. {
  41. "dps": SWITCH4_DPS,
  42. "name": "switch_outlet_4",
  43. "device_class": SwitchDeviceClass.OUTLET,
  44. },
  45. {
  46. "dps": SWITCHUSB_DPS,
  47. "name": "switch_usb_switch",
  48. "device_class": SwitchDeviceClass.SWITCH,
  49. },
  50. ]
  51. )
  52. self.mark_secondary(
  53. [
  54. "time_timer_1",
  55. "time_timer_2",
  56. "time_timer_3",
  57. "time_timer_4",
  58. "time_timer_usb",
  59. ]
  60. )