Forráskód Böngészése

Add tests for tmwf02_fan.yaml

- Remove unnecessary units from speed.
- Allow speed to go down to 0 (off)
- Unhide fan_level
- Scale timer to minutes, since it can only be set to minute increments, and polling is not frequent enough for countdown in seconds to be useful.
Jason Rumney 4 éve
szülő
commit
e53035e48b
2 módosított fájl, 15 hozzáadás és 7 törlés
  1. 8 7
      custom_components/tuya_local/devices/tmwf02_fan.yaml
  2. 7 0
      tests/const.py

+ 8 - 7
custom_components/tuya_local/devices/tmwf02_fan.yaml

@@ -1,21 +1,19 @@
-name: TMWF02 Wi-Fi Fan Module
+name: TMWF02 Fan Controller
 primary_entity:
   entity: fan
   dps:
     - id: 1
       type: boolean
       name: switch
+    - id: 3
+      type: string
+      name: fan_level
     - id: 4
       type: integer
       name: speed
-      unit: "%"
       range:
-        min: 1
+        min: 0
         max: 100
-    - id: 3
-      type: string
-      name: fan_level
-      hidden: true
 secondary_entities:
   - entity: number
     category: config
@@ -27,3 +25,6 @@ secondary_entities:
         range:
           min: 0
           max: 86400
+        mapping:
+          - scale: 60
+            step: 60

+ 7 - 0
tests/const.py

@@ -675,3 +675,10 @@ ASPEN_ASP200_FAN_PAYLOAD = {
     "101": True,
     "102": 3,
 }
+
+TMWF02_FAN_PAYLOAD = {
+    "1": True,
+    "2": 0,
+    "3": "level_2",
+    "4": 40,
+}