4
0

test_simple_switch_with_timer.py 723 B

123456789101112131415161718192021222324
  1. """Tests for a simple switch with timer"""
  2. from ..const import TIMED_SOCKET_PAYLOAD
  3. from ..mixins.switch import SwitchableTests
  4. from .base_device_tests import TuyaDeviceTestCase
  5. SWITCH_DPS = "1"
  6. TIMER_DPS = "11"
  7. class TestTimedSwitch(SwitchableTests, TuyaDeviceTestCase):
  8. __test__ = True
  9. def setUp(self):
  10. self.setUpForConfig("simple_switch_timer.yaml", TIMED_SOCKET_PAYLOAD)
  11. self.subject = self.entities.get("switch")
  12. self.setUpSwitchable(SWITCH_DPS, self.subject)
  13. self.mark_secondary(["time_timer"])
  14. def test_extra_state_attributes_set(self):
  15. self.assertDictEqual(
  16. self.subject.extra_state_attributes,
  17. {},
  18. )