test_smartplug_encoded.py 781 B

123456789101112131415161718192021222324
  1. """Tests for the switch entity."""
  2. from homeassistant.components.switch import SwitchDeviceClass
  3. from ..const import SMARTPLUG_ENCODED_PAYLOAD
  4. from ..mixins.switch import SwitchableTests
  5. from .base_device_tests import TuyaDeviceTestCase
  6. SWITCH_DPS = "1"
  7. TIMER_DPS = "11"
  8. RANDOM_DPS = "101"
  9. CIRCULATE_DPS = "102"
  10. SCHEDULE_DPS = "103"
  11. class TestSwitchEncoded(SwitchableTests, TuyaDeviceTestCase):
  12. def setUp(self):
  13. self.setUpForConfig("smartplug_encoded.yaml", SMARTPLUG_ENCODED_PAYLOAD)
  14. self.subject = self.entities.get("switch_outlet")
  15. self.setUpSwitchable(SWITCH_DPS, self.subject)
  16. self.mark_secondary(["time_timer"])
  17. def test_device_class_is_outlet(self):
  18. self.assertEqual(self.subject.device_class, SwitchDeviceClass.OUTLET)