Jelajahi Sumber

Mopping select: standardise icons and translations.

- remove superfluous names from lights (Light, Lights)
- migration added for naming variations

Issue #1708
Jason Rumney 1 tahun lalu
induk
melakukan
e0e2edda94
27 mengubah file dengan 87 tambahan dan 106 penghapusan
  1. 8 0
      custom_components/tuya_local/__init__.py
  2. 4 5
      custom_components/tuya_local/devices/abir_x8_vacuum.yaml
  3. 0 1
      custom_components/tuya_local/devices/amico_smart_ceiling_fan.yaml
  4. 0 1
      custom_components/tuya_local/devices/atomi_ceiling_fan.yaml
  5. 6 7
      custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml
  6. 5 6
      custom_components/tuya_local/devices/kabum_smart700_vacuum.yaml
  7. 0 1
      custom_components/tuya_local/devices/kogan_air_purifier.yaml
  8. 0 1
      custom_components/tuya_local/devices/kogan_bidet.yaml
  9. 3 4
      custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml
  10. 3 4
      custom_components/tuya_local/devices/kogan_lx8_vacuum.yaml
  11. 1 2
      custom_components/tuya_local/devices/lefant_n3_vacuum.yaml
  12. 1 2
      custom_components/tuya_local/devices/lefant_t700_vacuum.yaml
  13. 4 5
      custom_components/tuya_local/devices/lenovo_e1_vacuum.yaml
  14. 4 5
      custom_components/tuya_local/devices/liectroux_g7_vacuum.yaml
  15. 5 6
      custom_components/tuya_local/devices/liectroux_xr500_t3_vacuum.yaml
  16. 5 7
      custom_components/tuya_local/devices/lublueblu_sl60d_vacuum.yaml
  17. 7 7
      custom_components/tuya_local/devices/mamnv_br151_vacuum_and_mop.yaml
  18. 0 1
      custom_components/tuya_local/devices/mantra_fan.yaml
  19. 4 5
      custom_components/tuya_local/devices/medion_s20_vacuum.yaml
  20. 5 6
      custom_components/tuya_local/devices/neatsvor_x600_vacuum.yaml
  21. 6 7
      custom_components/tuya_local/devices/proscenic_m9_vacuum.yaml
  22. 0 2
      custom_components/tuya_local/devices/reiga_52_fan_light.yaml
  23. 0 1
      custom_components/tuya_local/devices/stadlerform_karl_humidifier.yaml
  24. 0 1
      custom_components/tuya_local/devices/sulion_ceiling_fan.yaml
  25. 5 6
      custom_components/tuya_local/devices/tesvor_s6_vacuum.yaml
  26. 5 6
      custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml
  27. 6 7
      custom_components/tuya_local/devices/zedar_r600_vacuum.yaml

+ 8 - 0
custom_components/tuya_local/__init__.py

@@ -602,6 +602,14 @@ async def async_migrate_entry(hass, entry: ConfigEntry):
                 "select_power_on_state": "select_initial_state",
                 "select_restart_status": "select_initial_state",
                 "select_poweron_status": "select_initial_state",
+                "select_mop_mode": "select_mopping",
+                "select_mop_control": "select_mopping",
+                "select_water_setting": "select_mopping",
+                "select_water_mode": "select_mopping",
+                "select_water_control": "select_mopping",
+                "select_water_tank": "select_mopping",
+                "light_light": "light",
+                "light_lights": "light",
             }
             for suffix, new_suffix in replacements.items():
                 if old_id.endswith(suffix):

+ 4 - 5
custom_components/tuya_local/devices/abir_x8_vacuum.yaml

@@ -208,19 +208,18 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     dps:
       - id: 10
         type: string
         name: option
         mapping:
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: button
     name: Reset map
     category: config

+ 0 - 1
custom_components/tuya_local/devices/amico_smart_ceiling_fan.yaml

@@ -33,7 +33,6 @@ primary_entity:
           value: reverse
 secondary_entities:
   - entity: light
-    name: Light
     dps:
       - id: 20
         type: boolean

+ 0 - 1
custom_components/tuya_local/devices/atomi_ceiling_fan.yaml

@@ -28,7 +28,6 @@ primary_entity:
       name: unknown_71
 secondary_entities:
   - entity: light
-    name: Light
     dps:
       - id: 20
         type: boolean

+ 6 - 7
custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml

@@ -246,8 +246,7 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     category: config
     dps:
       - id: 10
@@ -256,15 +255,15 @@ secondary_entities:
         optional: true
         mapping:
           - dps_val: closed
-            value: "Off"
+            value: "off"
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
           - dps_val: null
-            value: "Off"
+            value: "off"
             hidden: true
   - entity: button
     name: Reset map

+ 5 - 6
custom_components/tuya_local/devices/kabum_smart700_vacuum.yaml

@@ -153,8 +153,7 @@ secondary_entities:
         name: sensor
         unit: min
   - entity: select
-    name: Mop mode
-    icon: "mdi:brush"
+    translation_key: mopping
     category: config
     dps:
       - id: 102
@@ -162,13 +161,13 @@ secondary_entities:
         name: option
         mapping:
           - dps_val: "0"
-            value: "Off"
+            value: "off"
           - dps_val: "1"
-            value: Low
+            value: low
           - dps_val: "2"
-            value: Standard
+            value: medium
           - dps_val: "3"
-            value: Strong
+            value: high
   - entity: button
     name: Reset map
     category: config

+ 0 - 1
custom_components/tuya_local/devices/kogan_air_purifier.yaml

@@ -29,7 +29,6 @@ secondary_entities:
         type: integer
         unit: "%"
   - entity: light
-    name: Light
     category: config
     dps:
       - id: 101

+ 0 - 1
custom_components/tuya_local/devices/kogan_bidet.yaml

@@ -127,7 +127,6 @@ secondary_entities:
         type: boolean
         name: switch
   - entity: light
-    name: Light
     category: config
     dps:
       - id: 64

+ 3 - 4
custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml

@@ -175,9 +175,8 @@ secondary_entities:
         optional: true
         unit: m²
   - entity: select
-    name: Water mode
+    translation_key: mopping
     category: config
-    icon: "mdi:water"
     dps:
       - id: 110
         name: option
@@ -187,11 +186,11 @@ secondary_entities:
           - dps_val: 'off'
             value: 'off'
           - dps_val: quiet
-            value: quiet
+            value: low
           - dps_val: auto
             value: auto
           - dps_val: strong
-            value: strong
+            value: high
   - entity: switch
     name: Disturb switch
     category: config

+ 3 - 4
custom_components/tuya_local/devices/kogan_lx8_vacuum.yaml

@@ -174,9 +174,8 @@ secondary_entities:
         unit: m²
         optional: true
   - entity: select
-    name: Water mode
+    translation_key: mopping
     category: config
-    icon: "mdi:water"
     dps:
       - id: 110
         name: option
@@ -185,11 +184,11 @@ secondary_entities:
           - dps_val: 'off'
             value: 'off'
           - dps_val: quiet
-            value: quiet
+            value: low
           - dps_val: auto
             value: auto
           - dps_val: strong
-            value: strong
+            value: high
         optional: true
   - entity: switch
     name: Disturb switch

+ 1 - 2
custom_components/tuya_local/devices/lefant_n3_vacuum.yaml

@@ -282,8 +282,7 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     category: config
     dps:
       - id: 10

+ 1 - 2
custom_components/tuya_local/devices/lefant_t700_vacuum.yaml

@@ -113,8 +113,7 @@ secondary_entities:
         type: bitfield
         name: fault_code
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     category: config
     dps:
       - id: 101

+ 4 - 5
custom_components/tuya_local/devices/lenovo_e1_vacuum.yaml

@@ -213,8 +213,7 @@ secondary_entities:
           - dps_val: find_sta
             value: dock
   - entity: select
-    name: Mopping
-    icon: "mdi:format-color-fill"
+    translation_key: mopping
     category: config
     dps:
       - id: 120
@@ -222,8 +221,8 @@ secondary_entities:
         name: option
         mapping:
           - dps_val: water_small
-            value: Low
+            value: low
           - dps_val: water_big
-            value: High
+            value: high
           - dps_val: water_auto
-            value: Auto
+            value: auto

+ 4 - 5
custom_components/tuya_local/devices/liectroux_g7 → custom_components/tuya_local/devices/liectroux_g7_vacuum.yaml

@@ -177,9 +177,8 @@ secondary_entities:
         optional: true
         unit: m²
   - entity: select
-    name: Mopping mode
+    translation_key: mopping
     category: config
-    icon: "mdi:water"
     dps:
       - id: 110
         name: option
@@ -187,11 +186,11 @@ secondary_entities:
         optional: true
         mapping:
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: mid
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: switch
     name: Do not disturb
     category: config

+ 5 - 6
custom_components/tuya_local/devices/liectroux_xr500_t3_vacuum.yaml

@@ -208,21 +208,20 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     dps:
       - id: 10
         type: string
         name: option
         mapping:
           - dps_val: closed
-            value: "Off"
+            value: "off"
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: button
     name: Reset map
     category: config

+ 5 - 7
custom_components/tuya_local/devices/lublueblu_sl60d_vacuum.yaml

@@ -128,23 +128,21 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Water tank
+    translation_key: mopping
     category: config
-    class: enum
-    icon: "mdi:cup-water"
     dps:
       - id: 10
         type: string
         name: option
         mapping:
           - dps_val: closed
-            value: Closed
+            value: "off"
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: sensor
     name: Side brush lifetime
     category: diagnostic

+ 7 - 7
custom_components/tuya_local/devices/mamnv_br151_vacuum_and_mop.yaml

@@ -126,7 +126,7 @@ secondary_entities:
         name: sensor
         unit: min
   - entity: select
-    name: Water control
+    translation_key: mopping
     category: config
     icon: "mdi:cup-water"
     dps:
@@ -134,9 +134,9 @@ secondary_entities:
         name: option
         type: string
         mapping:
-          - dps_val: "closed"
-            value: "Off"
-          - dps_val: "low"
-            value: Low
-          - dps_val: "high"
-            value: Strong
+          - dps_val: closed
+            value: "off"
+          - dps_val: low
+            value: low
+          - dps_val: high
+            value: high

+ 0 - 1
custom_components/tuya_local/devices/mantra_fan.yaml

@@ -117,7 +117,6 @@ secondary_entities:
         name: sensor
         unit: min
   - entity: light
-    name: Light
     dps:
       - id: 9
         type: boolean

+ 4 - 5
custom_components/tuya_local/devices/medion_s20_vacuum.yaml

@@ -162,8 +162,7 @@ secondary_entities:
         unit: min
         class: measurement
   - entity: select
-    name: Mop control
-    icon: "mdi:format-color-fill"
+    translation_key: mopping
     category: config
     dps:
       - id: 20
@@ -171,11 +170,11 @@ secondary_entities:
         name: option
         mapping:
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: button
     name: Factory reset
     category: config

+ 5 - 6
custom_components/tuya_local/devices/neatsvor_x600_vacuum.yaml

@@ -167,21 +167,20 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Water setting
-    icon: "mdi:water"
+    translation_key: mopping
     dps:
       - id: 10
         name: option
         type: string
         mapping:
           - dps_val: closed
-            value: "Off"
+            value: "off"
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: medium
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: sensor
     name: Side brush life
     category: diagnostic

+ 6 - 7
custom_components/tuya_local/devices/proscenic_m9_vacuum.yaml

@@ -218,8 +218,7 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Water setting
-    icon: "mdi:water"
+    translation_key: mopping
     dps:
       - id: 10
         name: option
@@ -230,17 +229,17 @@ secondary_entities:
               - dps_val: installed
                 mapping:
                   - dps_val: closed
-                    value: "Off"
+                    value: "off"
                   - dps_val: low
-                    value: Low
+                    value: low
                   - dps_val: middle
-                    value: Middle
+                    value: medium
                   - dps_val: high
-                    value: High
+                    value: high
               - dps_val: none
                 mapping:
                   - dps_val: closed
-                    value: "Off"
+                    value: "off"
       - id: 40
         name: mopstate
         type: string

+ 0 - 2
custom_components/tuya_local/devices/reiga_52_fan_light.yaml

@@ -48,8 +48,6 @@ secondary_entities:
           - dps_val: "8hour"
             value: "8h"
   - entity: light
-    name: Light
-    icon: "mdi:lightbulb"
     category: config
     dps:
       - id: 15

+ 0 - 1
custom_components/tuya_local/devices/stadlerform_karl_humidifier.yaml

@@ -58,7 +58,6 @@ secondary_entities:
         name: sensor
         unit: "%"
   - entity: light
-    name: Lights
     category: config
     dps:
       - id: 34

+ 0 - 1
custom_components/tuya_local/devices/sulion_ceiling_fan.yaml

@@ -28,7 +28,6 @@ primary_entity:
           value: nature
 secondary_entities:
   - entity: light
-    name: Light
     category: config
     dps:
       - id: 103

+ 5 - 6
custom_components/tuya_local/devices/tesvor_s6_vacuum.yaml

@@ -197,8 +197,7 @@ secondary_entities:
         name: sensor
         unit: m2
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     category: config
     dps:
       - id: 10
@@ -206,13 +205,13 @@ secondary_entities:
         name: option
         mapping:
           - dps_val: closed
-            value: "Off"
+            value: "off"
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: button
     name: Reset map
     class: restart

+ 5 - 6
custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml

@@ -217,8 +217,7 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     category: config
     dps:
       - id: 10
@@ -226,13 +225,13 @@ secondary_entities:
         name: option
         mapping:
           - dps_val: closed
-            value: "Off"
+            value: "off"
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle]
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
   - entity: button
     name: Reset map
     category: config

+ 6 - 7
custom_components/tuya_local/devices/zedar_r600_vacuum.yaml

@@ -224,8 +224,7 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Mopping
-    icon: "mdi:cup-water"
+    translation_key: mopping
     category: config
     dps:
       - id: 10
@@ -234,15 +233,15 @@ secondary_entities:
         optional: true
         mapping:
           - dps_val: closed
-            value: "Off"
+            value: "off"
           - dps_val: low
-            value: Low
+            value: low
           - dps_val: middle
-            value: Medium
+            value: medium
           - dps_val: high
-            value: High
+            value: high
           - dps_val: null
-            value: "Off"
+            value: "off"
             hidden: true
   - entity: button
     name: Reset map