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

Plantsio Ivy: changes from review

- remove unnecessary names to allow translations to be used
- fix use of binary_sensor
- remove inappropriate class
- use target language for language names
- use light entity for display brightness
Jason Rumney 1 год назад
Родитель
Сommit
7a53bc1c38
1 измененных файлов с 11 добавлено и 24 удалено
  1. 11 24
      custom_components/tuya_local/devices/plantsio_ivy_smart_planter.yaml

+ 11 - 24
custom_components/tuya_local/devices/plantsio_ivy_smart_planter.yaml

@@ -25,7 +25,6 @@ primary_entity:
 secondary_entities:
 secondary_entities:
   # Sensor entities raw
   # Sensor entities raw
   - entity: sensor
   - entity: sensor
-    name: Ambient light
     class: illuminance
     class: illuminance
     dps:
     dps:
       - id: 103
       - id: 103
@@ -34,7 +33,6 @@ secondary_entities:
         unit: lx
         unit: lx
         class: measurement
         class: measurement
   - entity: sensor
   - entity: sensor
-    name: Temperature
     class: temperature
     class: temperature
     dps:
     dps:
       - id: 104
       - id: 104
@@ -45,7 +43,6 @@ secondary_entities:
         mapping:
         mapping:
           - scale: 10
           - scale: 10
   - entity: sensor
   - entity: sensor
-    name: Humidity
     class: humidity
     class: humidity
     dps:
     dps:
       - id: 105
       - id: 105
@@ -54,7 +51,6 @@ secondary_entities:
         unit: "%"
         unit: "%"
         class: measurement
         class: measurement
   - entity: sensor
   - entity: sensor
-    name: Soil moisture
     class: moisture
     class: moisture
     dps:
     dps:
       - id: 122
       - id: 122
@@ -137,7 +133,6 @@ secondary_entities:
           - value: "Unknown state"
           - value: "Unknown state"
   # Diagnostic entities
   # Diagnostic entities
   - entity: sensor
   - entity: sensor
-    name: Battery
     class: battery
     class: battery
     category: diagnostic
     category: diagnostic
     dps:
     dps:
@@ -146,30 +141,19 @@ secondary_entities:
         name: sensor
         name: sensor
         unit: "%"
         unit: "%"
   - entity: binary_sensor
   - entity: binary_sensor
-    name: Charge state
     class: battery_charging
     class: battery_charging
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 109
       - id: 109
         type: boolean
         type: boolean
         name: sensor
         name: sensor
-  - entity: sensor
+  - entity: binary_sensor
     name: Plant in pot
     name: Plant in pot
-    class: problem
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 102
       - id: 102
         type: boolean
         type: boolean
         name: sensor
         name: sensor
-  - entity: sensor
-    name: Touching
-    icon: "mdi:gesture-tap"
-    category: diagnostic
-    dps:
-      - id: 111
-        type: string
-        name: sensor
-        optional: true
   # Config entities
   # Config entities
   - entity: select
   - entity: select
     translation_key: temperature_unit
     translation_key: temperature_unit
@@ -311,6 +295,10 @@ secondary_entities:
       - id: 110
       - id: 110
         type: boolean
         type: boolean
         name: switch
         name: switch
+      - id: 111
+        type: string
+        name: touching
+        optional: true
   - entity: switch
   - entity: switch
     name: Auto brightness
     name: Auto brightness
     category: config
     category: config
@@ -319,14 +307,13 @@ secondary_entities:
       - id: 135
       - id: 135
         type: boolean
         type: boolean
         name: switch
         name: switch
-  - entity: number
-    name: Brightness
+  - entity: light
+    translation_key: display
     category: config
     category: config
-    icon: "mdi:brightness-percent"
     dps:
     dps:
       - id: 101
       - id: 101
         type: integer
         type: integer
-        name: value
+        name: brightness
         range:
         range:
           min: 0
           min: 0
           max: 100
           max: 100
@@ -421,13 +408,13 @@ secondary_entities:
         name: option
         name: option
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
-            value: "Chinese"
+            value: "中文"
           - dps_val: 1
           - dps_val: 1
             value: "English"
             value: "English"
           - dps_val: 2
           - dps_val: 2
-            value: "Japanese"
+            value: "日本語"
           - dps_val: 3
           - dps_val: 3
-            value: "French"
+            value: "Français"
   - entity: switch
   - entity: switch
     name: Location weather
     name: Location weather
     icon: "mdi:weather-pouring"
     icon: "mdi:weather-pouring"