Explorar o código

feat(riyue_box3_fanlight): changes from review

- add back timer and fault related entities
- use text entity for switch gradient
- add text entities for advanced light settings
- use category: config for non-primary config options
- allow translations to be used in place of hardcoded names
- follow HA naming convention

PR #3660
Jason Rumney hai 5 meses
pai
achega
4968bf50c2
Modificáronse 1 ficheiros con 79 adicións e 17 borrados
  1. 79 17
      custom_components/tuya_local/devices/riyue_box3_fanlight.yaml

+ 79 - 17
custom_components/tuya_local/devices/riyue_box3_fanlight.yaml

@@ -1,11 +1,11 @@
-name: Ceiling Fan Light
+name: Ceiling fan light
 products:
 products:
   - id: shrracpw0ve9jooc
   - id: shrracpw0ve9jooc
-    manufacturer: RIYUE
-    model: RIYUE BOX 3
+    manufacturer: Riyue
+    model: Box 3
 entities:
 entities:
   - entity: fan
   - entity: fan
-    name: Fan
+    translation_key: fan_with_presets
     dps:
     dps:
       - id: 60
       - id: 60
         type: boolean
         type: boolean
@@ -25,7 +25,6 @@ entities:
           min: 1
           min: 1
           max: 100
           max: 100
   - entity: light
   - entity: light
-    name: Light
     dps:
     dps:
       - id: 20
       - id: 20
         type: boolean
         type: boolean
@@ -37,9 +36,6 @@ entities:
         range:
         range:
           min: 10
           min: 10
           max: 1000
           max: 1000
-        mapping:
-          - dps_val: null
-            value: 0
       - id: 23
       - id: 23
         name: color_temp
         name: color_temp
         type: integer
         type: integer
@@ -51,20 +47,35 @@ entities:
           - target_range:
           - target_range:
               min: 2700
               min: 2700
               max: 6500
               max: 6500
+  - entity: text
+    name: Scene
+    category: config
+    hidden: true
+    dps:
       - id: 25
       - id: 25
-        name: scene_data
+        name: value
         type: string
         type: string
         optional: true
         optional: true
+  - entity: text
+    name: Music
+    category: config
+    hidden: true
+    dps:
       - id: 27
       - id: 27
-        name: music_data
+        name: value
         type: string
         type: string
         optional: true
         optional: true
+  - entity: text
+    name: Light control
+    category: config
+    hidden: true
+    dps:
       - id: 28
       - id: 28
-        name: control_data
+        name: value
         type: string
         type: string
         optional: true
         optional: true
   - entity: light
   - entity: light
-    name: Night light
+    translation_key: nightlight
     dps:
     dps:
       - id: 105
       - id: 105
         type: boolean
         type: boolean
@@ -127,21 +138,72 @@ entities:
       - id: 34
       - id: 34
         type: boolean
         type: boolean
         name: switch
         name: switch
-  - entity: switch
+  - entity: text
     name: Switch gradient
     name: Switch gradient
+    category: config
+    hidden: true
     dps:
     dps:
       - id: 35
       - id: 35
-        type: raw
-        name: switch
+        type: base64
+        optional: true
+        name: value
   - entity: switch
   - entity: switch
-    name: Fan beeper
+    name: Fan beep
+    category: config
     dps:
     dps:
       - id: 66
       - id: 66
         type: boolean
         type: boolean
         name: switch
         name: switch
   - entity: switch
   - entity: switch
-    name: General beeper
+    translation_key: keytone
+    category: config
     dps:
     dps:
       - id: 106
       - id: 106
         type: boolean
         type: boolean
         name: switch
         name: switch
+  - entity: time
+    translation_key: timer
+    category: config
+    dps:
+      - id: 26
+        type: integer
+        name: second
+        range:
+          min: 0
+          max: 86400
+  - entity: sensor
+    translation_key: time_remaining
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 64
+        type: integer
+        name: sensor
+        unit: min
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 67
+        type: bitfield
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 67
+        type: bitfield
+        optional: true
+        name: fault_code
+      - id: 67
+        type: bitfield
+        optional: true
+        name: description
+        mapping:
+          - dps_val: 0
+            value: ok
+          - dps_val: 1
+            value: motor_fault