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

cleanup (translations): clean up misused class and translation keys

Issues uncovered by expansion of translation checking.
Jason Rumney 22 часов назад
Родитель
Сommit
e27ba04b7d
21 измененных файлов с 46 добавлено и 27 удалено
  1. 1 1
      custom_components/tuya_local/devices/airwoods_avew8df_hrv.yaml
  2. 1 1
      custom_components/tuya_local/devices/arida_venti160_hrv.yaml
  3. 1 1
      custom_components/tuya_local/devices/avatto_zwt198_thermostat.yaml
  4. 0 1
      custom_components/tuya_local/devices/camnsmart_e27_camera.yaml
  5. 1 1
      custom_components/tuya_local/devices/catit_pixi_smart_fountain.yaml
  6. 7 0
      custom_components/tuya_local/devices/electriq_desd9lw_dehumidifier.yaml
  7. 7 0
      custom_components/tuya_local/devices/electriq_desd9lwv2_dehumidifier.yaml
  8. 1 1
      custom_components/tuya_local/devices/engo_e901wifi_thermostat.yaml
  9. 0 1
      custom_components/tuya_local/devices/evsun_evcharger.yaml
  10. 1 1
      custom_components/tuya_local/devices/fourin1_motion_sensor.yaml
  11. 7 0
      custom_components/tuya_local/devices/globe_ceilingfanrgbcwlight.yaml
  12. 1 1
      custom_components/tuya_local/devices/gotzejensen_kt975k_kettle.yaml
  13. 2 6
      custom_components/tuya_local/devices/haozee_presence_wallswitch.yaml
  14. 0 1
      custom_components/tuya_local/devices/inkbird_isc007bw_smokercontrol.yaml
  15. 14 1
      custom_components/tuya_local/devices/klarstein_bornholm_smart_heater.yaml
  16. 1 1
      custom_components/tuya_local/devices/petory_f03w_petfeeder.yaml
  17. 0 1
      custom_components/tuya_local/devices/pgst_pw150_alarm.yaml
  18. 0 1
      custom_components/tuya_local/devices/pir_sensor_alarm.yaml
  19. 1 3
      custom_components/tuya_local/devices/staniot_smart_security_panel.yaml
  20. 0 2
      custom_components/tuya_local/devices/tesla_airconditioner.yaml
  21. 0 2
      custom_components/tuya_local/devices/vivion_airconditioner.yaml

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

@@ -123,7 +123,7 @@ entities:
         optional: true
         optional: true
         name: fault_code
         name: fault_code
   - entity: binary_sensor
   - entity: binary_sensor
-    translation_key: connectivity
+    class: connectivity
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 101
       - id: 101

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

@@ -122,7 +122,7 @@ entities:
         optional: true
         optional: true
         name: fault_code
         name: fault_code
   - entity: binary_sensor
   - entity: binary_sensor
-    translation_key: connectivity
+    class: connectivity
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 101
       - id: 101

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

@@ -99,7 +99,7 @@ entities:
           - scale: 10
           - scale: 10
             step: 5
             step: 5
   - entity: number
   - entity: number
-    translation_key: minximum_temperature
+    translation_key: minimum_temperature
     category: config
     category: config
     dps:
     dps:
       - id: 16
       - id: 16

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

@@ -206,7 +206,6 @@ entities:
             icon: "mdi:motion-sensor-off"
             icon: "mdi:motion-sensor-off"
   - entity: button
   - entity: button
     class: restart
     class: restart
-    name: Restart
     category: config
     category: config
     dps:
     dps:
       - id: 162
       - id: 162

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

@@ -112,7 +112,7 @@ entities:
             value: true
             value: true
 
 
   - entity: binary_sensor
   - entity: binary_sensor
-    translation_key: running
+    class: running
     dps:
     dps:
       - id: 103
       - id: 103
         type: boolean
         type: boolean

+ 7 - 0
custom_components/tuya_local/devices/electriq_desd9lw_dehumidifier.yaml

@@ -76,6 +76,13 @@ entities:
           min: 16
           min: 16
           max: 30
           max: 30
   - entity: light
   - entity: light
+    name: UV sterilization
+    deprecated: switch.uv_sterilization  # 2026-03-02
+    dps:
+      - id: 15
+        name: switch
+        type: boolean
+  - entity: switch
     translation_key: uv_sterilization
     translation_key: uv_sterilization
     dps:
     dps:
       - id: 15
       - id: 15

+ 7 - 0
custom_components/tuya_local/devices/electriq_desd9lwv2_dehumidifier.yaml

@@ -71,6 +71,13 @@ entities:
           min: 16
           min: 16
           max: 30
           max: 30
   - entity: light
   - entity: light
+    name: UV sterilization
+    deprecated: switch.uv_sterilization  # 2026-03-02
+    dps:
+      - id: 15
+        name: switch
+        type: boolean
+  - entity: switch
     translation_key: uv_sterilization
     translation_key: uv_sterilization
     dps:
     dps:
       - id: 15
       - id: 15

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

@@ -62,7 +62,7 @@ entities:
           - scale: 10
           - scale: 10
             step: 5
             step: 5
   - entity: lock
   - entity: lock
-    translation_key: child_Lock
+    translation_key: child_lock
     category: config
     category: config
     dps:
     dps:
       - id: 40
       - id: 40

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

@@ -292,7 +292,6 @@ entities:
         optional: true
         optional: true
         name: value
         name: value
   - entity: sensor
   - entity: sensor
-    name: Temperature
     class: temperature
     class: temperature
     category: diagnostic
     category: diagnostic
     dps:
     dps:

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

@@ -103,7 +103,7 @@ entities:
           min: -10
           min: -10
           max: 10
           max: 10
   - entity: sensor
   - entity: sensor
-    translation_key: illuminance
+    class: illuminance
     dps:
     dps:
       - id: 106
       - id: 106
         type: integer
         type: integer

+ 7 - 0
custom_components/tuya_local/devices/globe_ceilingfanrgbcwlight.yaml

@@ -87,6 +87,13 @@ entities:
         type: boolean
         type: boolean
         name: switch
         name: switch
   - entity: switch
   - entity: switch
+    name: Nightlight
+    deprecated: light.nightlight  # 2026-03-02
+    dps:
+      - id: 53
+        type: boolean
+        name: switch
+  - entity: light
     translation_key: nightlight
     translation_key: nightlight
     dps:
     dps:
       - id: 53
       - id: 53

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

@@ -128,7 +128,7 @@ entities:
           min: 0
           min: 0
           max: 100
           max: 100
   - entity: sensor
   - entity: sensor
-    translation_key: remaining_time
+    name: Remaining time
     class: duration
     class: duration
     category: diagnostic
     category: diagnostic
     dps:
     dps:

+ 2 - 6
custom_components/tuya_local/devices/haozee_presence_wallswitch.yaml

@@ -5,17 +5,13 @@ products:
     model: ZG-302ZM 2-gang
     model: ZG-302ZM 2-gang
 entities:
 entities:
   - entity: light
   - entity: light
-    translation_key: switch_x
-    translation_placeholders:
-      x: "1"
+    name: Switch 1
     dps:
     dps:
       - id: 101
       - id: 101
         type: boolean
         type: boolean
         name: switch
         name: switch
   - entity: light
   - entity: light
-    translation_key: switch_x
-    translation_placeholders:
-      x: "2"
+    name: Switch 2
     dps:
     dps:
       - id: 102
       - id: 102
         type: boolean
         type: boolean

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

@@ -223,7 +223,6 @@ entities:
   - entity: sensor
   - entity: sensor
     name: Usage time
     name: Usage time
     class: duration
     class: duration
-    translation_key: timer
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 119
       - id: 119

+ 14 - 1
custom_components/tuya_local/devices/klarstein_bornholm_smart_heater.yaml

@@ -64,7 +64,20 @@ entities:
           - dps_val: false
           - dps_val: false
             value: true
             value: true
   - entity: light
   - entity: light
-    translation_key: display_light
+    name: Display light
+    deprecated: light.backlight  # 2026-03-02
+    category: config
+    dps:
+      - id: 102
+        type: boolean
+        name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
+  - entity: light
+    translation_key: backlight
     category: config
     category: config
     dps:
     dps:
       - id: 102
       - id: 102

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

@@ -101,7 +101,7 @@ entities:
           min: 0
           min: 0
           max: 10
           max: 10
   - entity: light
   - entity: light
-    translation_key: indeicator
+    translation_key: indicator
     category: config
     category: config
     dps:
     dps:
       - id: 19
       - id: 19

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

@@ -115,7 +115,6 @@ entities:
         name: switch
         name: switch
         optional: true
         optional: true
   - entity: event
   - entity: event
-    name: Doorbell
     class: doorbell
     class: doorbell
     category: diagnostic
     category: diagnostic
     dps:
     dps:

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

@@ -3,7 +3,6 @@ products:
   - id: y5tdmwmb2ieknmkb
   - id: y5tdmwmb2ieknmkb
 entities:
 entities:
   - entity: binary_sensor
   - entity: binary_sensor
-    translation_key: motion
     class: motion
     class: motion
     dps:
     dps:
       - id: 1
       - id: 1

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

@@ -101,15 +101,13 @@ entities:
         type: boolean
         type: boolean
         name: switch
         name: switch
   - entity: binary_sensor
   - entity: binary_sensor
-    translation_key: plug
-    class: power
+    class: plug
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 15
       - id: 15
         type: boolean
         type: boolean
         name: sensor
         name: sensor
   - entity: sensor
   - entity: sensor
-    translation_key: battery_level
     class: battery
     class: battery
     category: diagnostic
     category: diagnostic
     dps:
     dps:

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

@@ -181,7 +181,6 @@ entities:
         name: fault_code
         name: fault_code
   - entity: switch
   - entity: switch
     name: "On timer"
     name: "On timer"
-    translation_key: timer
     category: config
     category: config
     dps:
     dps:
       - id: 109
       - id: 109
@@ -189,7 +188,6 @@ entities:
         name: switch
         name: switch
   - entity: switch
   - entity: switch
     name: "Off timer"
     name: "Off timer"
-    translation_key: timer
     category: config
     category: config
     dps:
     dps:
       - id: 110
       - id: 110

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

@@ -165,7 +165,6 @@ entities:
         name: switch
         name: switch
   - entity: switch
   - entity: switch
     name: Timer on
     name: Timer on
-    translation_key: timer
     category: config
     category: config
     dps:
     dps:
       - id: 101
       - id: 101
@@ -173,7 +172,6 @@ entities:
         name: switch
         name: switch
   - entity: switch
   - entity: switch
     name: Timer off
     name: Timer off
-    translation_key: timer
     category: config
     category: config
     dps:
     dps:
       - id: 102
       - id: 102