瀏覽代碼

cleanup (translations): use available translations when they match

- add a utility script to detect entities with explicit names that
  match an existing translation_key.
- ran the script and found a bunch of improvements
Jason Rumney 3 周之前
父節點
當前提交
bd3852a7b1
共有 87 個文件被更改,包括 172 次插入204 次删除
  1. 1 1
      custom_components/tuya_local/devices/DH-CSK03W_dehumidifier.yaml
  2. 1 2
      custom_components/tuya_local/devices/abir_x8_vacuum.yaml
  3. 5 6
      custom_components/tuya_local/devices/absina_evcharger.yaml
  4. 6 7
      custom_components/tuya_local/devices/afyeev_16a_evcharger.yaml
  5. 1 1
      custom_components/tuya_local/devices/afyeev_evcharger.yaml
  6. 7 8
      custom_components/tuya_local/devices/ampbolt_portable_evcharger.yaml
  7. 1 2
      custom_components/tuya_local/devices/asahom_outdoor_rgbcw_lights.yaml
  8. 1 1
      custom_components/tuya_local/devices/asip_0622_planter.yaml
  9. 1 2
      custom_components/tuya_local/devices/aulifants_energymonitor_breaker.yaml
  10. 1 1
      custom_components/tuya_local/devices/ble_kb150a_lock.yaml
  11. 1 1
      custom_components/tuya_local/devices/ble_solar_light.yaml
  12. 1 2
      custom_components/tuya_local/devices/blitzwill_ceilingfanlight.yaml
  13. 4 7
      custom_components/tuya_local/devices/catit_pixi_smart_fountain.yaml
  14. 2 4
      custom_components/tuya_local/devices/doel_tiplus_litterbox.yaml
  15. 4 5
      custom_components/tuya_local/devices/dowell_dchs-k7_32_7kw_ev_charger.yaml
  16. 1 2
      custom_components/tuya_local/devices/dreamlight_led_strip.yaml
  17. 1 2
      custom_components/tuya_local/devices/dts238_7_energy_meter.yaml
  18. 1 1
      custom_components/tuya_local/devices/dynasty_btx_fireplace.yaml
  19. 4 5
      custom_components/tuya_local/devices/ecopoint_ev_charger.yaml
  20. 1 1
      custom_components/tuya_local/devices/etop_fcu_thermostat.yaml
  21. 6 7
      custom_components/tuya_local/devices/evsun_evcharger.yaml
  22. 1 2
      custom_components/tuya_local/devices/fancyled_fpgahdmi2_light.yaml
  23. 1 2
      custom_components/tuya_local/devices/feit_onesync_lightcontroller.yaml
  24. 1 2
      custom_components/tuya_local/devices/fresco_hydrateultra_petfountain.yaml
  25. 1 2
      custom_components/tuya_local/devices/fresco_hydrateultra_petfountain_v2.yaml
  26. 1 2
      custom_components/tuya_local/devices/gts8_40_2P_breaker.yaml
  27. 1 2
      custom_components/tuya_local/devices/hombli_cctxmas_lights.yaml
  28. 1 1
      custom_components/tuya_local/devices/idoo_smartbloom8_planter.yaml
  29. 1 2
      custom_components/tuya_local/devices/ilife_v20_vacuum.yaml
  30. 1 2
      custom_components/tuya_local/devices/imitos_downlight.yaml
  31. 1 1
      custom_components/tuya_local/devices/inline_ultrasonic_aromadiffuser.yaml
  32. 6 6
      custom_components/tuya_local/devices/junsun_ev_charger.yaml
  33. 1 2
      custom_components/tuya_local/devices/kabum_smart700_vacuum.yaml
  34. 1 1
      custom_components/tuya_local/devices/keyun_rgb_ceilingfan.yaml
  35. 1 1
      custom_components/tuya_local/devices/klarta_humea_humidifier.yaml
  36. 1 2
      custom_components/tuya_local/devices/ledvance_smart_ceilingfan.yaml
  37. 1 2
      custom_components/tuya_local/devices/leos_loo_too.yaml
  38. 1 2
      custom_components/tuya_local/devices/ligency_fl15b1p_fanlight.yaml
  39. 3 4
      custom_components/tuya_local/devices/loycco_sound_nightlight.yaml
  40. 2 4
      custom_components/tuya_local/devices/lsc_neon_ledstrip.yaml
  41. 1 2
      custom_components/tuya_local/devices/lsc_rgbcct_ledstrip.yaml
  42. 1 2
      custom_components/tuya_local/devices/lscsmartconnect_partystring_light.yaml
  43. 1 1
      custom_components/tuya_local/devices/lumary_a1_ceilingfanlight.yaml
  44. 1 2
      custom_components/tuya_local/devices/lumary_b2_ceilingfanlight.yaml
  45. 1 1
      custom_components/tuya_local/devices/mayborn_groclock.yaml
  46. 1 2
      custom_components/tuya_local/devices/medion_x10sw_vacuum.yaml
  47. 1 2
      custom_components/tuya_local/devices/meegeem_selfcleaningcatlitterbox.yaml
  48. 1 1
      custom_components/tuya_local/devices/moes_motionsensor_switch.yaml
  49. 1 1
      custom_components/tuya_local/devices/moes_starfeather_switch.yaml
  50. 1 2
      custom_components/tuya_local/devices/moes_zcjk_alarmclock.yaml
  51. 1 1
      custom_components/tuya_local/devices/multi_leaf_dy_107_thermostat.yaml
  52. 2 4
      custom_components/tuya_local/devices/neo_naswv02w_watervalve.yaml
  53. 1 2
      custom_components/tuya_local/devices/nexsmart_air3_camera.yaml
  54. 6 7
      custom_components/tuya_local/devices/nine_ev_charger.yaml
  55. 3 4
      custom_components/tuya_local/devices/noeifevo_q21w_evcharger.yaml
  56. 1 1
      custom_components/tuya_local/devices/petoneer_frescomini_petfountain.yaml
  57. 4 7
      custom_components/tuya_local/devices/petrust_tkwf002_petfountain.yaml
  58. 2 3
      custom_components/tuya_local/devices/petsnowy_snowplus_catlitter.yaml
  59. 1 5
      custom_components/tuya_local/devices/plantsio_ivy_smart_planter.yaml
  60. 1 2
      custom_components/tuya_local/devices/prism_oasispro_fanlight.yaml
  61. 2 2
      custom_components/tuya_local/devices/rgbcw_lightbulb_xld_cl002.yaml
  62. 1 1
      custom_components/tuya_local/devices/riyue_box3_fanlight.yaml
  63. 1 1
      custom_components/tuya_local/devices/simple_dual_switch_timer_v2.yaml
  64. 1 1
      custom_components/tuya_local/devices/single_phase_clamp_meter.yaml
  65. 1 1
      custom_components/tuya_local/devices/smart_motorized_pop_up_socket.yaml
  66. 1 2
      custom_components/tuya_local/devices/smartmcb_smt006_energymeter.yaml
  67. 1 2
      custom_components/tuya_local/devices/smartmcb_smt006_energymeterv2.yaml
  68. 1 3
      custom_components/tuya_local/devices/sobralik_water_fountain.yaml
  69. 2 2
      custom_components/tuya_local/devices/spaelectrics_light_controller.yaml
  70. 1 1
      custom_components/tuya_local/devices/stadlerform_noah_humidifier.yaml
  71. 1 1
      custom_components/tuya_local/devices/tefal_xplorer_vacuum.yaml
  72. 1 2
      custom_components/tuya_local/devices/tesla_aroma_diffuser.yaml
  73. 1 2
      custom_components/tuya_local/devices/tonepie_t1pro_catlitterbox.yaml
  74. 1 2
      custom_components/tuya_local/devices/tonepie_t1pro_catlitterbox_max.yaml
  75. 1 2
      custom_components/tuya_local/devices/tonepie_t1pro_catlitterbox_v2.yaml
  76. 1 1
      custom_components/tuya_local/devices/tongou_qcb2100_circuitbreaker.yaml
  77. 1 1
      custom_components/tuya_local/devices/tongou_qcb2wb_breaker.yaml
  78. 1 2
      custom_components/tuya_local/devices/tongou_toqsyswt_breaker.yaml
  79. 1 1
      custom_components/tuya_local/devices/ustellar_ut99911_rgb.yaml
  80. 1 2
      custom_components/tuya_local/devices/varin_rgbcw_ceilingfan.yaml
  81. 1 1
      custom_components/tuya_local/devices/vibrance_fireplace.yaml
  82. 1 1
      custom_components/tuya_local/devices/wetair_wawh1210lw_humidifier.yaml
  83. 1 2
      custom_components/tuya_local/devices/zedar_k1200_litterbox.yaml
  84. 1 2
      custom_components/tuya_local/devices/zemismart_spm01_energymeter.yaml
  85. 1 2
      custom_components/tuya_local/devices/zg205w_mmWave_presence_sensor.yaml
  86. 1 2
      custom_components/tuya_local/devices/zigbee_ultrasonic_watermeter.yaml
  87. 34 0
      util/untranslated_entities.py

+ 1 - 1
custom_components/tuya_local/devices/DH-CSK03W_dehumidifier.yaml

@@ -53,7 +53,7 @@ entities:
           - dps_val: "48h"
             value: "48h"
   - entity: select
-    name: "Light mode"
+    translation_key: light_mode
     category: config
     dps:
       - id: 31

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

@@ -190,9 +190,8 @@ entities:
         type: boolean
         name: switch
   - entity: number
-    name: Volume
+    translation_key: volume
     category: config
-    icon: "mdi:volume-high"
     dps:
       - id: 26
         type: integer

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

@@ -83,8 +83,7 @@ entities:
             value: "err_pe_sck"
 
   - entity: select  # work_mode -14- OK
-    name: Charging mode
-    icon: "mdi:ev-station"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14
@@ -92,13 +91,13 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Immediate charge
+            value: immediate
           - dps_val: charge_schedule
-            value: Scheduled charge
+            value: scheduled_charge
           - dps_val: charge_pct
-            value: Charge to percent
+            value: charge_to_percent
           - dps_val: charge_energy
-            value: Fixed charge
+            value: fixed_charge
       - id: 11  # alarm_set_1 -11-
         type: string
         name: alarm_set_1

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

@@ -171,8 +171,7 @@ entities:
           - dps_val: 16384
             value: Earth leak
   - entity: select
-    name: Charging mode
-    icon: "mdi:ev-station"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14
@@ -181,15 +180,15 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Charge now
+            value: immediate
           - dps_val: charge_pct
-            value: Charge PCT
+            value: charge_to_percent
           - dps_val: charge_energy
-            value: Charge energy
+            value: fixed_charge
           - dps_val: charge_schedule
-            value: Charge schedule
+            value: scheduled_charge
           - dps_val: charge_delay
-            value: Charge delay
+            value: delayed_charge
   - entity: sensor
     name: Balance energy
     class: energy_storage

+ 1 - 1
custom_components/tuya_local/devices/afyeev_evcharger.yaml

@@ -138,7 +138,7 @@ entities:
           - dps_val: 16384
             value: "Leakage current fault"
   - entity: select
-    name: charging_mode
+    translation_key: charging_mode
     dps:
       - id: 14
         type: string

+ 7 - 8
custom_components/tuya_local/devices/ampbolt_portable_evcharger.yaml

@@ -214,8 +214,7 @@ entities:
           - dps_val: controlpi_error
             value: fault
   - entity: select
-    name: Charging mode
-    icon: "mdi:car-select"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14
@@ -224,17 +223,17 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Immediate
+            value: immediate
           - dps_val: charge_pct
-            value: Charge to percent
+            value: charge_to_percent
           - dps_val: charge_energy
-            value: Fixed energy
+            value: fixed_charge
           - dps_val: charge_schedule
-            value: Scheduled
+            value: scheduled_charge
           - dps_val: charge_delay
-            value: Delayed
+            value: delayed_charge
           - dps_val: null
-            value: Immediate
+            value: immediate
             hidden: true
   - entity: switch
     category: config

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

@@ -146,8 +146,7 @@ entities:
         optional: true
         name: information
   - entity: select
-    name: Light mode
-    icon: "mdi:lightbulb-question"
+    translation_key: light_mode
     category: config
     dps:
       - id: 117

+ 1 - 1
custom_components/tuya_local/devices/asip_0622_planter.yaml

@@ -96,7 +96,7 @@ entities:
         name: limits
         # format: min,max
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     dps:
       - id: 103
         type: integer

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

@@ -55,8 +55,7 @@ entities:
         name: button
         optional: true
   - entity: switch
-    name: Breaker
-    icon: "mdi:fuse"
+    translation_key: breaker
     category: config
     dps:
       - id: 16

+ 1 - 1
custom_components/tuya_local/devices/ble_kb150a_lock.yaml

@@ -119,7 +119,7 @@ entities:
           min: 1
           max: 1800
   - entity: switch
-    name: do_not_disturb
+    translation_key: do_not_disturb
     category: config
     dps:
       - id: 76

+ 1 - 1
custom_components/tuya_local/devices/ble_solar_light.yaml

@@ -92,7 +92,7 @@ entities:
           min: 0
           max: 86400
   - entity: select
-    name: mode
+    translation_key: mode
     icon: "mdi:lightbulb-auto"
     category: config
     dps:

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

@@ -61,9 +61,8 @@ entities:
               min: 2700
               max: 6500
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 25

+ 4 - 7
custom_components/tuya_local/devices/catit_pixi_smart_fountain.yaml

@@ -63,7 +63,7 @@ entities:
         type: boolean
         name: switch
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     class: enum
     category: diagnostic
     dps:
@@ -72,14 +72,11 @@ entities:
         type: string
         mapping:
           - dps_val: level_1
-            icon: "mdi:cup-outline"
-            value: Low
+            value: low
           - dps_val: level_2
-            icon: "mdi:cup-water"
-            value: Medium
+            value: medium
           - dps_val: level_3
-            icon: "mdi:cup"
-            value: Full
+            value: full
   - entity: sensor
     name: UV runtime
     class: duration

+ 2 - 4
custom_components/tuya_local/devices/doel_tiplus_litterbox.yaml

@@ -91,9 +91,8 @@ entities:
         type: boolean
         name: sensor
   - entity: switch
-    name: Auto clean
+    translation_key: auto_clean
     category: config
-    icon: "mdi:auto-mode"
     dps:
       - id: 105
         type: boolean
@@ -234,9 +233,8 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Sleep
+    translation_key: sleep
     category: config
-    icon: "mdi:sleep"
     dps:
       - id: 120
         type: boolean

+ 4 - 5
custom_components/tuya_local/devices/dowell_dchs-k7_32_7kw_ev_charger.yaml

@@ -172,8 +172,7 @@ entities:
           - dps_val: controlpi_error
             value: Error
   - entity: select
-    name: Charging mode
-    icon: "mdi:ev-station"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14    # work_mode
@@ -182,11 +181,11 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Plug and Play
+            value: immediate
           - dps_val: charge_energy
-            value: Normal mode
+            value: fixed_charge
           - dps_val: charge_schedule
-            value: Scheduled
+            value: scheduled_charge
   - entity: sensor
     translation_key: voltage_x
     translation_placeholders:

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

@@ -126,8 +126,7 @@ entities:
           - dps_val: "music"
             value: "Music"
   - entity: select
-    name: Scene
-    icon: "mdi:palette"
+    translation_key: scene
     category: config
     dps:
       - id: 51

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

@@ -110,8 +110,7 @@ entities:
           min: 0
           max: 5000
   - entity: switch
-    name: Breaker
-    icon: "mdi:fuse"
+    translation_key: breaker
     category: config
     dps:
       - id: 16

+ 1 - 1
custom_components/tuya_local/devices/dynasty_btx_fireplace.yaml

@@ -154,7 +154,7 @@ entities:
           - dps_val: "3"
             value: High
   - entity: light
-    name: Embers
+    translation_key: embers
     dps:
       - id: 106
         type: string

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

@@ -124,8 +124,7 @@ entities:
           - dps_val: controlpi_error
             value: Error
   - entity: select
-    name: Charging mode
-    icon: "mdi:ev-station"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14  # work_mode
@@ -134,11 +133,11 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Immediate
+            value: immediate
           - dps_val: charge_energy
-            value: Fixed charge
+            value: fixed_charge
           - dps_val: charge_schedule
-            value: Scheduled charge
+            value: scheduled_charge
   - entity: sensor
     translation_key: voltage_x
     translation_placeholders:

+ 1 - 1
custom_components/tuya_local/devices/etop_fcu_thermostat.yaml

@@ -5,7 +5,7 @@ products:
     model: FCU / JRT-100TW
 entities:
   - entity: climate
-    name: Thermostat
+    translation_key: thermostat
     dps:
       ############################################################
       # Setpoint and current temperature

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

@@ -172,8 +172,7 @@ entities:
           - dps_val: controlpi_error
             value: Error
   - entity: select
-    name: Charging mode
-    icon: "mdi:ev-station"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14
@@ -181,15 +180,15 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Immediate
+            value: immediate
           - dps_val: charge_pct
-            value: Charge to percent
+            value: charge_to_percent
           - dps_val: charge_energy
-            value: Fixed charge
+            value: fixed_charge
           - dps_val: charge_schedule
-            value: Scheduled charge
+            value: scheduled_charge
           - dps_val: charge_delay
-            value: Delayed charge
+            value: delayed_charge
   - entity: sensor
     name: Remaining
     class: energy_storage

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

@@ -79,8 +79,7 @@ entities:
             step: 60
           - dps_val: null
   - entity: select
-    name: Scene
-    icon: "mdi:palette"
+    translation_key: scene
     category: config
     dps:
       - id: 25

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

@@ -40,9 +40,8 @@ entities:
           - dps_val: 5000K
             value: 5000
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 25

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

@@ -115,8 +115,7 @@ entities:
         optional: true
 
   - entity: sensor
-    name: Water level
-    icon: "mdi:water"
+    translation_key: water_level
     category: diagnostic
     dps:
       - id: 108

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

@@ -13,8 +13,7 @@ entities:
         name: valve
 
   - entity: sensor
-    name: Water level
-    icon: "mdi:water"
+    translation_key: water_level
     category: diagnostic
     dps:
       - id: 9

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

@@ -4,8 +4,7 @@ products:
     model: GTS8-40 2P
 entities:
   - entity: switch
-    name: Breaker
-    icon: "mdi:fuse"
+    translation_key: breaker
     dps:
       - id: 1
         type: boolean

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

@@ -59,9 +59,8 @@ entities:
         type: string
         name: value
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 52

+ 1 - 1
custom_components/tuya_local/devices/idoo_smartbloom8_planter.yaml

@@ -84,7 +84,7 @@ entities:
         mapping:
           - step: 10
   - entity: switch
-    name: Sleep
+    translation_key: sleep
     category: config
     dps:
       - id: 107

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

@@ -277,9 +277,8 @@ entities:
         unit: min
         optional: true
   - entity: number
-    name: Volume
+    translation_key: volume
     category: config
-    icon: "mdi:volume-high"
     dps:
       - id: 26
         type: integer

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

@@ -105,9 +105,8 @@ entities:
         optional: true
         name: value
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 73

+ 1 - 1
custom_components/tuya_local/devices/inline_ultrasonic_aromadiffuser.yaml

@@ -136,7 +136,7 @@ entities:
         optional: true
         name: switch
   - entity: switch
-    name: keytone
+    translation_key: keytone
     category: config
     dps:
       - id: 101

+ 6 - 6
custom_components/tuya_local/devices/junsun_ev_charger.yaml

@@ -130,7 +130,7 @@ entities:
           - dps_val: 16384
             value: "Leakage current fault"
   - entity: select
-    name: Charging mode
+    translation_key: charging_mode
     icon: "mdi:ev-station"
     dps:
       - id: 14
@@ -138,15 +138,15 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Charge now
+            value: immediate
           - dps_val: charge_pct
-            value: Charge PCT
+            value: charge_to_percent
           - dps_val: charge_energy
-            value: Charge energy
+            value: fixed_charge
           - dps_val: charge_schedule
-            value: Charge schedule
+            value: scheduled_charge
           - dps_val: charge_delay
-            value: Charge delay
+            value: delayed_charge
   - entity: switch
     icon: "mdi:ev-station"
     dps:

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

@@ -270,9 +270,8 @@ entities:
           - dps_val: en
             value: english
   - entity: number
-    name: Volume
+    translation_key: volume
     category: config
-    icon: "mdi:volume-high"
     dps:
       - id: 112
         type: integer

+ 1 - 1
custom_components/tuya_local/devices/keyun_rgb_ceilingfan.yaml

@@ -166,7 +166,7 @@ entities:
           - name: wc
             bytes: 2
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
     icon: "mdi:palette"
     hidden: true

+ 1 - 1
custom_components/tuya_local/devices/klarta_humea_humidifier.yaml

@@ -86,7 +86,7 @@ entities:
           min: 1
           max: 4
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     category: diagnostic
     dps:
       - id: 101

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

@@ -49,9 +49,8 @@ entities:
               min: 2700
               max: 6500
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 25

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

@@ -22,8 +22,7 @@ entities:
         type: boolean
   - entity: select
     category: config
-    name: Cleaning mode
-    icon: "mdi:refresh-auto"
+    translation_key: cleaning_mode
     dps:
       - id: 2
         type: string

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

@@ -57,9 +57,8 @@ entities:
               min: 0
               max: 1000
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 25

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

@@ -55,8 +55,7 @@ entities:
         name: power
         optional: true
   - entity: select
-    name: Light mode
-    icon: "mdi:lightbulb-question"
+    translation_key: light_mode
     category: config
     dps:
       - id: 4
@@ -66,9 +65,9 @@ entities:
           - dps_val: breath
             value: Breathing
           - dps_val: light_on
-            value: Steady On
+            value: "on"
           - dps_val: light_off
-            value: "Off"
+            value: "off"
           - dps_val: change
             value: Random
   - entity: siren

+ 2 - 4
custom_components/tuya_local/devices/lsc_neon_ledstrip.yaml

@@ -94,9 +94,8 @@ entities:
           min: 1
           max: 1000
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 51
@@ -104,8 +103,7 @@ entities:
         optional: true
         name: value
   - entity: select
-    name: Scene
-    icon: "mdi:palette"
+    translation_key: scene
     category: config
     dps:
       - id: 51

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

@@ -98,9 +98,8 @@ entities:
         name: sensor
         unit: px
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 51

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

@@ -68,9 +68,8 @@ entities:
         optional: true
         name: value
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 56

+ 1 - 1
custom_components/tuya_local/devices/lumary_a1_ceilingfanlight.yaml

@@ -286,7 +286,7 @@ entities:
         type: boolean
         name: main_switch
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
     icon: "mdi:palette"
     hidden: true

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

@@ -136,9 +136,8 @@ entities:
         type: boolean
         name: switch
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 109

+ 1 - 1
custom_components/tuya_local/devices/mayborn_groclock.yaml

@@ -70,7 +70,7 @@ entities:
         optional: true
         name: snooze
   - entity: select
-    name: Alarm mode
+    translation_key: alarm_mode
     icon: "mdi:alarm"
     category: config
     dps:

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

@@ -172,8 +172,7 @@ entities:
         unit: "%"
         class: measurement
   - entity: select
-    name: Mopping
-    icon: "mdi:water"
+    translation_key: mopping
     dps:
       - id: 10
         type: string

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

@@ -177,8 +177,7 @@ entities:
           max: 20
 
   - entity: switch
-    name: Auto-clean
-    icon: "mdi:delete-empty"
+    translation_key: auto_clean
     category: config
     dps:
       - id: 102

+ 1 - 1
custom_components/tuya_local/devices/moes_motionsensor_switch.yaml

@@ -50,7 +50,7 @@ entities:
           - dps_val: "off"
             value: "off"
   - entity: select
-    name: light_mode
+    translation_key: light_mode
     category: config
     dps:
       - id: 15

+ 1 - 1
custom_components/tuya_local/devices/moes_starfeather_switch.yaml

@@ -151,7 +151,7 @@ entities:
             value: false
           - value: true
   - entity: light
-    name: backlight
+    translation_key: backlight
     category: config
     dps:
       - id: 36

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

@@ -104,8 +104,7 @@ entities:
           - dps_val: "4"
             value: Radio + Sound + Light
   - entity: switch
-    name: Sleep
-    icon: "mdi:sleep"
+    translation_key: sleep
     dps:
       - id: 121
         type: boolean

+ 1 - 1
custom_components/tuya_local/devices/multi_leaf_dy_107_thermostat.yaml

@@ -164,7 +164,7 @@ entities:
           - dps_val: "70"
             value: "7 days"
   - entity: light
-    name: Backlight
+    translation_key: backlight
     category: config
     dps:
       - id: 44

+ 2 - 4
custom_components/tuya_local/devices/neo_naswv02w_watervalve.yaml

@@ -62,10 +62,9 @@ entities:
         type: boolean
         name: switch
   - entity: number
-    name: Minimum temperature
+    translation_key: minimum_temperature
     category: config
     class: temperature
-    icon: "mdi:thermometer-minus"
     dps:
       - id: 104
         type: integer
@@ -79,10 +78,9 @@ entities:
         type: boolean
         name: available
   - entity: number
-    name: Maximum temperature
+    translation_key: maximum_temperature
     category: config
     class: temperature
-    icon: "mdi:thermometer-plus"
     dps:
       - id: 105
         type: integer

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

@@ -166,8 +166,7 @@ entities:
   # 5. Alarm Mode & Linkage
   # ------------------------------------
   - entity: select
-    name: Alarm mode
-    icon: "mdi:bell-ring-outline"
+    translation_key: alarm_mode
     category: config
     # Alarm Mode (matches alarm_mode: 243)
     dps:

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

@@ -112,8 +112,7 @@ entities:
           - dps_val: 16384
             value: "Leakage current fault"
   - entity: select
-    name: Charging mode
-    icon: "mdi:ev-station"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14  # work_mode
@@ -122,15 +121,15 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Always on
+            value: immediate
           - dps_val: charge_energy
-            value: Charge energy limit
+            value: fixed_charge
           - dps_val: charge_schedule
-            value: Scheduled charge
+            value: scheduled_charge
           - dps_val: charge_pct
-            value: Charge percent limt
+            value: charge_to_percent
           - dps_val: charge_delay
-            value: Delayed charge
+            value: delayed_charge
   - entity: sensor
     translation_key: voltage_x
     translation_placeholders:

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

@@ -71,8 +71,7 @@ entities:
         type: bitfield
         name: fault_code
   - entity: select
-    name: Charging mode
-    icon: "mdi:ev-station"
+    translation_key: charging_mode
     category: config
     dps:
       - id: 14
@@ -81,9 +80,9 @@ entities:
         name: option
         mapping:
           - dps_val: charge_now
-            value: Immediate
+            value: immediate
           - dps_val: charge_schedule
-            value: Scheduled charge
+            value: scheduled_charge
   - entity: sensor
     translation_key: voltage_x
     translation_placeholders:

+ 1 - 1
custom_components/tuya_local/devices/petoneer_frescomini_petfountain.yaml

@@ -41,7 +41,7 @@ entities:
         name: sensor
         unit: min
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     category: diagnostic
     dps:
       - id: 108

+ 4 - 7
custom_components/tuya_local/devices/petrust_tkwf002_petfountain.yaml

@@ -103,7 +103,7 @@ entities:
         type: boolean
         name: button
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     class: enum
     category: diagnostic
     dps:
@@ -112,14 +112,11 @@ entities:
         type: string
         mapping:
           - dps_val: "low"
-            icon: "mdi:cup-outline"
-            value: "Low"
+            value: "low"
           - dps_val: "middle"
-            icon: "mdi:cup-water"
-            value: "Middle"
+            value: "medium"
           - dps_val: "high"
-            icon: "mdi:cup"
-            value: "High"
+            value: "high"
   - entity: sensor
     name: Water age
     class: duration

+ 2 - 3
custom_components/tuya_local/devices/petsnowy_snowplus_catlitter.yaml

@@ -5,9 +5,8 @@ products:
     model: Snow+
 entities:
   - entity: switch
-    name: Auto clean
+    translation_key: auto_clean
     category: config
-    icon: "mdi:flower"
     dps:
       - id: 4
         type: boolean
@@ -157,7 +156,7 @@ entities:
             value: Trouble removal
           - value: Unknown
   - entity: sensor
-    name: Status
+    translation_key: status
     category: diagnostic
     dps:
       - id: 24

+ 1 - 5
custom_components/tuya_local/devices/plantsio_ivy_smart_planter.yaml

@@ -8,7 +8,7 @@ products:
     model: Ivy
 entities:
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     class: volume_storage
     dps:
       - id: 108
@@ -16,10 +16,6 @@ entities:
         name: sensor
         unit: mL
         class: measurement
-        mapping:
-          - dps_val: 0
-            icon: "mdi:cup-outline"
-          - icon: "mdi:cup"
       - id: 107
         type: string
         name: version

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

@@ -59,9 +59,8 @@ entities:
               min: 0
               max: 1000
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 25

+ 2 - 2
custom_components/tuya_local/devices/rgbcw_lightbulb_xld_cl002.yaml

@@ -98,7 +98,7 @@ entities:
           min: 0
           max: 86400
   - entity: text
-    name: scene
+    translation_key: scene
     category: config
     hidden: true
     dps:
@@ -107,7 +107,7 @@ entities:
         type: base64
         optional: true
   - entity: select
-    name: scene
+    translation_key: scene
     category: config
     dps:
       - id: 51

+ 1 - 1
custom_components/tuya_local/devices/riyue_box3_fanlight.yaml

@@ -48,7 +48,7 @@ entities:
               min: 2700
               max: 6500
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
     hidden: true
     dps:

+ 1 - 1
custom_components/tuya_local/devices/simple_dual_switch_timer_v2.yaml

@@ -72,7 +72,7 @@ entities:
             value: false
           - value: true
   - entity: select
-    name: light_mode
+    translation_key: light_mode
     category: config
     hidden: unavailable
     dps:

+ 1 - 1
custom_components/tuya_local/devices/single_phase_clamp_meter.yaml

@@ -56,7 +56,7 @@ entities:
           - dps_val: idle
             value: Idle
   - entity: sensor
-    name: status
+    translation_key: status
     class: enum
     category: diagnostic
     dps:

+ 1 - 1
custom_components/tuya_local/devices/smart_motorized_pop_up_socket.yaml

@@ -74,7 +74,7 @@ entities:
             value: closed
   - entity: sensor
     class: enum
-    name: Status
+    translation_key: status
     dps:
       - id: 101
         readonly: true

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

@@ -5,8 +5,7 @@ products:
     model: SMT006-10
 entities:
   - entity: switch
-    icon: "mdi:fuse"
-    name: Breaker
+    translation_key: breaker
     dps:
       - id: 16
         type: boolean

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

@@ -8,8 +8,7 @@ products:
     model: SMT006-8
 entities:
   - entity: switch
-    icon: "mdi:fuse"
-    name: Breaker
+    translation_key: breaker
     dps:
       - id: 16
         type: boolean

+ 1 - 3
custom_components/tuya_local/devices/sobralik_water_fountain.yaml

@@ -108,7 +108,7 @@ entities:
           max: 31
         unit: d
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     class: enum
     category: diagnostic
     dps:
@@ -117,8 +117,6 @@ entities:
         type: string
         mapping:
           - dps_val: level_1
-            icon: "mdi:cup-outline"
             value: low
           - dps_val: level_2
-            icon: "mdi:cup"
             value: high

+ 2 - 2
custom_components/tuya_local/devices/spaelectrics_light_controller.yaml

@@ -560,9 +560,9 @@ entities:
         optional: true
         name: button
   - entity: button
-    name: Factory reset
-    class: restart
+    translation_key: factory_reset
     category: config
+    hidden: true
     dps:
       - id: 162
         type: boolean

+ 1 - 1
custom_components/tuya_local/devices/stadlerform_noah_humidifier.yaml

@@ -66,7 +66,7 @@ entities:
         name: sensor
         unit: "%"
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     icon: mdi:cup-water
     category: diagnostic
     dps:

+ 1 - 1
custom_components/tuya_local/devices/tefal_xplorer_vacuum.yaml

@@ -157,7 +157,7 @@ entities:
         optional: true
         hidden: true
   - entity: select
-    name: Mode
+    translation_key: mode
     category: config
     dps:
       - id: 3

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

@@ -111,8 +111,7 @@ entities:
         name: sensor
         unit: min
   - entity: select
-    name: Light mode
-    icon: "mdi:palette"
+    translation_mode: light_mode
     category: config
     dps:
       - id: 101

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

@@ -95,9 +95,8 @@ entities:
         type: boolean
         name: sensor
   - entity: switch
-    name: Auto clean
+    translation_key: auto_clean
     category: config
-    icon: "mdi:shimmer"
     dps:
       - id: 105
         type: boolean

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

@@ -55,8 +55,7 @@ entities:
   # Configuration Settings
   # Enables automatic cleaning after cat visits
   - entity: switch
-    name: Auto clean
-    icon: "mdi:shimmer"
+    translation_key: auto_clean
     category: config
     dps:
       - id: 4

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

@@ -79,9 +79,8 @@ entities:
         type: boolean
         name: sensor
   - entity: switch
-    name: Auto clean
+    translation_key: auto_clean
     category: config
-    icon: "mdi:shimmer"
     dps:
       - id: 4
         type: boolean

+ 1 - 1
custom_components/tuya_local/devices/tongou_qcb2100_circuitbreaker.yaml

@@ -15,7 +15,7 @@ entities:
         unit: mA
         class: measurement
   - entity: switch
-    name: Breaker
+    translation_key: breaker
     dps:
       - id: 16
         type: boolean

+ 1 - 1
custom_components/tuya_local/devices/tongou_qcb2wb_breaker.yaml

@@ -28,7 +28,7 @@ entities:
         unit: mA
         class: measurement
   - entity: switch
-    name: Breaker
+    translation_key: breaker
     dps:
       - id: 16
         type: boolean

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

@@ -104,8 +104,7 @@ entities:
         mapping:
           - scale: 100
   - entity: switch
-    name: Breaker
-    icon: "mdi:fuse"
+    translation_key: breaker
     dps:
       - id: 16
         type: boolean

+ 1 - 1
custom_components/tuya_local/devices/ustellar_ut99911_rgb.yaml

@@ -115,7 +115,7 @@ entities:
           - dps_val: 464
             value: "Disco 100%"
   - entity: select
-    name: Mode
+    translation_key: mode
     icon: "mdi:playlist-edit"
     category: config
     dps:

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

@@ -197,9 +197,8 @@ entities:
               min: 0
               max: 1000
   - entity: text
-    name: Scene
+    translation_key: scene
     category: config
-    icon: "mdi:palette"
     hidden: true
     dps:
       - id: 109

+ 1 - 1
custom_components/tuya_local/devices/vibrance_fireplace.yaml

@@ -107,7 +107,7 @@ entities:
           - dps_val: "3"
             value: fast
   - entity: number
-    name: Volume
+    translation_key: volume
     dps:
       - id: 109
         type: string

+ 1 - 1
custom_components/tuya_local/devices/wetair_wawh1210lw_humidifier.yaml

@@ -57,7 +57,7 @@ entities:
             icon: "mdi:volume-off"
 
   - entity: sensor
-    name: Water level
+    translation_key: water_level
     category: diagnostic
     dps:
       - id: 101

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

@@ -12,9 +12,8 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Auto clean
+    translation_key: auto_clean
     category: config
-    icon: "mdi:refresh-auto"
     dps:
       - id: 4
         type: boolean

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

@@ -108,8 +108,7 @@ entities:
         mapping:
           - scale: 100
   - entity: switch
-    name: Breaker
-    icon: "mdi:fuse"
+    translation_key: breaker
     category: config
     dps:
       - id: 16

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

@@ -91,9 +91,8 @@ entities:
         name: switch
         optional: true
   - entity: select
-    name: Alarm mode
+    translation_key: alarm_mode
     class: enum
-    icon: mdi:shield-home
     category: config
     dps:
       - id: 104

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

@@ -80,8 +80,7 @@ entities:
         type: boolean
         name: valve
   - entity: switch
-    name: Auto clean
-    icon: "mdi:shimmer"
+    translation_key: auto_clean
     category: config
     dps:
       - id: 14

+ 34 - 0
util/untranslated_entities.py

@@ -0,0 +1,34 @@
+"""Find entities with names that match existing translation keys."""
+
+import json
+import sys
+from custom_components.tuya_local.helpers.device_config import (
+    TuyaDeviceConfig,
+    available_configs,
+)
+from homeassistant.util import slugify
+
+
+def main() -> int:
+    with open("custom_components/tuya_local/translations/en.json", "r") as f:
+        english = json.load(f)
+    for config in available_configs():
+        device = TuyaDeviceConfig(config)
+        for entity in device.all_entities():
+            if (
+                entity.translation_key
+                or entity.name is None
+                or entity.entity not in english["entity"]
+            ):
+                continue
+            translations = english["entity"][entity.entity]
+            slug = slugify(entity.name)
+            if slug in translations:
+                print(
+                    f"{config}:{entity._config.__line__}: can use translation_key: {slug}"
+                )
+    return 0
+
+
+if __name__ == "__main__":
+    sys.exit(main())