test_avatto_curtain_switch.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. """Tests for the Avatto roller blinds controller."""
  2. from ..const import AVATTO_CURTAIN_PAYLOAD
  3. from ..helpers import assert_device_properties_set
  4. from ..mixins.light import BasicLightTests
  5. from ..mixins.select import BasicSelectTests
  6. from ..mixins.button import MultiButtonTests
  7. from .base_device_tests import TuyaDeviceTestCase
  8. COMMAND_DP = "1"
  9. BACKLIGHT_DP = "101"
  10. class TestAvattoCurtainSwitch(
  11. MultiButtonTests, BasicSelectTests, BasicLightTests, TuyaDeviceTestCase
  12. ):
  13. __test__ = True
  14. def setUp(self):
  15. self.setUpForConfig("avatto_curtain_switch.yaml", AVATTO_CURTAIN_PAYLOAD)
  16. self.setUpMultiButtons(
  17. [
  18. {
  19. "dps": COMMAND_DP,
  20. "name": "button_stop",
  21. "testdata": "stop",
  22. },
  23. {
  24. "dps": COMMAND_DP,
  25. "name": "button_open",
  26. "testdata": "open",
  27. },
  28. {
  29. "dps": COMMAND_DP,
  30. "name": "button_close",
  31. "testdata": "close",
  32. },
  33. ]
  34. )
  35. self.setUpBasicSelect(
  36. COMMAND_DP,
  37. self.entities.get("select"),
  38. {
  39. "stop": "Stop",
  40. "open": "Open",
  41. "close": "Close",
  42. },
  43. ),
  44. self.setUpBasicLight(
  45. BACKLIGHT_DP,
  46. self.entities.get("light_backlight"),
  47. )
  48. self.mark_secondary(["select", "light_backlight"])