Browse Source

feat(eglo_ceiling_fan): support version with light

Since the product id is the same, the same WiFi adapter seems to be used for the
non-light and light models. The light model also has preset_mode, and it is possible
another variant exists with this but without the light, so conditionally enable that
based on itself rather than the light

PR #4899
Jason Rumney 2 months ago
parent
commit
a029c72731
1 changed files with 73 additions and 0 deletions
  1. 73 0
      custom_components/tuya_local/devices/eglo_ceiling_fan.yaml

+ 73 - 0
custom_components/tuya_local/devices/eglo_ceiling_fan.yaml

@@ -5,10 +5,30 @@ products:
     model: Surf
     model: Surf
 entities:
 entities:
   - entity: fan
   - entity: fan
+    translation_only_key: fan_with_presets
     dps:
     dps:
       - id: 60
       - id: 60
         type: boolean
         type: boolean
         name: switch
         name: switch
+      - id: 61
+        type: string
+        optional: true
+        name: preset_mode
+        mapping:
+          - dps_val: fresh
+            value: fresh
+            available: preset_supported
+          - dps_val: nature
+            value: nature
+            available: preset_supported
+      - id: 61
+        type: string
+        optional: true
+        name: preset_supported
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
       - id: 62
       - id: 62
         type: integer
         type: integer
         name: speed
         name: speed
@@ -43,3 +63,56 @@ entities:
           min: 0
           min: 0
           max: 540
           max: 540
         unit: min
         unit: min
+  - entity: light
+    hidden: unavailable
+    dps:
+      - id: 20
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 20
+        type: boolean
+        optional: true
+        name: switch
+      - id: 22
+        type: integer
+        optional: true
+        name: brightness
+        range:
+          min: 10
+          max: 1000
+      - id: 23
+        type: integer
+        optional: true
+        name: color_temp
+        range:
+          min: 0
+          max: 1000
+        mapping:
+          - target_range:
+              min: 3000
+              max: 5000
+            step: 500
+  - entity: time
+    name: Light timer
+    hidden: unavailable
+    dps:
+      - id: 20
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 26
+        type: integer
+        optional: true
+        name: second
+        range:
+          min: 0
+          max: 86399