test_smartplug_encoded.py 802 B

1234567891011121314151617181920212223242526
  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. __test__ = True
  13. def setUp(self):
  14. self.setUpForConfig("smartplug_encoded.yaml", SMARTPLUG_ENCODED_PAYLOAD)
  15. self.subject = self.entities.get("switch_outlet")
  16. self.setUpSwitchable(SWITCH_DPS, self.subject)
  17. self.mark_secondary(["time_timer"])
  18. def test_device_class_is_outlet(self):
  19. self.assertEqual(self.subject.device_class, SwitchDeviceClass.OUTLET)