4
0

test_simple_switch_with_timer.py 700 B

12345678910111213141516171819202122
  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. def setUp(self):
  9. self.setUpForConfig("simple_switch_timer.yaml", TIMED_SOCKET_PAYLOAD)
  10. self.subject = self.entities.get("switch")
  11. self.setUpSwitchable(SWITCH_DPS, self.subject)
  12. self.mark_secondary(["time_timer"])
  13. def test_extra_state_attributes_set(self):
  14. self.assertDictEqual(
  15. self.subject.extra_state_attributes,
  16. {},
  17. )