Преглед изворни кода

Update tests for timer attribute of arlec fan.

Last commit changed the data type, update the tests to reflect that.
off is a boolean value in yaml, quote it when it is intended to be a string.
Jason Rumney пре 4 година
родитељ
комит
9b44c04877
3 измењених фајлова са 4 додато и 4 уклоњено
  1. 1 1
      custom_components/tuya_local/devices/arlec_fan.yaml
  2. 1 1
      tests/const.py
  3. 2 2
      tests/devices/test_arlec_fan.py

+ 1 - 1
custom_components/tuya_local/devices/arlec_fan.yaml

@@ -30,7 +30,7 @@ primary_entity:
       name: timer
       name: timer
       type: string
       type: string
       mapping:
       mapping:
-        - dps_val: off
+        - dps_val: "off"
         - dps_val: 2hour
         - dps_val: 2hour
         - dps_val: 4hour
         - dps_val: 4hour
         - dps_val: 8hour
         - dps_val: 8hour

+ 1 - 1
tests/const.py

@@ -420,7 +420,7 @@ ARLEC_FAN_PAYLOAD = {
     "3": 1,
     "3": 1,
     "4": "forward",
     "4": "forward",
     "102": "normal",
     "102": "normal",
-    "103": 0,
+    "103": "off",
 }
 }
 
 
 CARSON_CB_PAYOAD = {
 CARSON_CB_PAYOAD = {

+ 2 - 2
tests/devices/test_arlec_fan.py

@@ -127,5 +127,5 @@ class TestArlecFan(TuyaDeviceTestCase):
             await self.subject.async_set_percentage(80)
             await self.subject.async_set_percentage(80)
 
 
     def test_device_state_attributes(self):
     def test_device_state_attributes(self):
-        self.dps[TIMER_DPS] = "5"
-        self.assertEqual(self.subject.device_state_attributes, {"timer": 5})
+        self.dps[TIMER_DPS] = "2hour"
+        self.assertEqual(self.subject.device_state_attributes, {"timer": "2hour"})