Просмотр исходного кода

Multi-leaf DY-107: changes from review

Suggested changes
 - naming
 - use of existing translation_keys
 - use of light entity
Jason Rumney 1 год назад
Родитель
Сommit
e69645dd68
1 измененных файлов с 8 добавлено и 17 удалено
  1. 8 17
      custom_components/tuya_local/devices/multi_leaf_dy_107_thermostat.yaml

+ 8 - 17
custom_components/tuya_local/devices/multi_leaf_dy_107_thermostat.yaml

@@ -1,7 +1,7 @@
-name: Multi-leaf DY-107 thermostat
+name: Thermostat
 products:
 products:
   - id: gdusjavy8i4dpjlt
   - id: gdusjavy8i4dpjlt
-    name: Multi-leaf DY-107 thermostat
+    name: Multi-leaf DY-107
 primary_entity:
 primary_entity:
   entity: climate
   entity: climate
   translation_key: thermostat
   translation_key: thermostat
@@ -76,26 +76,20 @@ secondary_entities:
           min: -9
           min: -9
           max: 9
           max: 9
   - entity: switch
   - entity: switch
-    name: Anti-frost
-    icon: "mdi:snowflake-melt"
+    translation_key: anti_frost
     category: config
     category: config
     dps:
     dps:
       - id: 10
       - id: 10
         type: boolean
         type: boolean
         name: switch
         name: switch
   - entity: lock
   - entity: lock
-    name: Child lock
+    translation_key: child_lock
     category: config
     category: config
     dps:
     dps:
       - id: 40
       - id: 40
         optional: true
         optional: true
         type: boolean
         type: boolean
         name: lock
         name: lock
-        mapping:
-          - dps_val: true
-            icon: "mdi:hand-back-right-off"
-          - dps_val: false
-            icon: "mdi:hand-back-right"
   - entity: select
   - entity: select
     name: Sensor selection
     name: Sensor selection
     category: config
     category: config
@@ -114,7 +108,6 @@ secondary_entities:
             icon: "mdi:thermometer"
             icon: "mdi:thermometer"
             value: Both
             value: Both
   - entity: binary_sensor
   - entity: binary_sensor
-    name: Error
     category: diagnostic
     category: diagnostic
     class: problem
     class: problem
     dps:
     dps:
@@ -126,7 +119,7 @@ secondary_entities:
             value: false
             value: false
           - value: true
           - value: true
   - entity: number
   - entity: number
-    name: High temperature limit
+    name: Maximum temperature
     category: config
     category: config
     class: temperature
     class: temperature
     icon: "mdi:thermometer-chevron-up"
     icon: "mdi:thermometer-chevron-up"
@@ -139,7 +132,7 @@ secondary_entities:
           min: 30
           min: 30
           max: 90
           max: 90
   - entity: number
   - entity: number
-    name: Low temperature limit
+    name: Minimum temperature
     category: config
     category: config
     class: temperature
     class: temperature
     icon: "mdi:thermometer-chevron-down"
     icon: "mdi:thermometer-chevron-down"
@@ -181,16 +174,14 @@ secondary_entities:
             value: "7 days"
             value: "7 days"
           - dps_val: null
           - dps_val: null
             value_redirect: alt
             value_redirect: alt
-  - entity: number
+  - entity: light
     name: Backlight
     name: Backlight
     category: config
     category: config
-    icon: "mdi:lightbulb-on"
     dps:
     dps:
       - id: 44
       - id: 44
         type: integer
         type: integer
-        name: value
+        name: brightness
         optional: true
         optional: true
-        unit: "%"
         range:
         range:
           min: 0
           min: 0
           max: 100
           max: 100