Quellcode durchsuchen

Ovlaim fan: change speed from string to integer

Original report in #749 did not come with logs, but the documentation
listed this as a string. But discussion #1728 suggests that this is not
detected correctly, and the difference between Casafan and this affecting
detection is only the type of speed dp. Other than that the color_temp
is present but disabled on Casafan, and presents and timer have different
values, but these do not affect detection.

There is code from early in development to not be strict about the type of
quoted integers, so making this integer should still work if there is older
firmware that really does use string.

Discussion #1728
Jason Rumney vor 2 Jahren
Ursprung
Commit
78b9b10598
1 geänderte Dateien mit 4 neuen und 14 gelöschten Zeilen
  1. 4 14
      custom_components/tuya_local/devices/ovlaim_ceiling_fan_light.yaml

+ 4 - 14
custom_components/tuya_local/devices/ovlaim_ceiling_fan_light.yaml

@@ -21,20 +21,10 @@ primary_entity:
           value: nature
     - id: 3
       name: speed
-      type: string
-      mapping:
-        - dps_val: "1"
-          value: 17
-        - dps_val: "2"
-          value: 33
-        - dps_val: "3"
-          value: 50
-        - dps_val: "4"
-          value: 67
-        - dps_val: "5"
-          value: 83
-        - dps_val: "6"
-          value: 100
+      type: integer
+      range:
+        min: 1
+        max: 6
     - id: 8
       name: direction
       type: string