Răsfoiți Sursa

feat(status sensors): increase translation use

- Many EV chargers have separate status for the charger and the vehicle/plug.
  We can use the status translation_key for both as long as one keeps
  its hardcoded name. This allows states to be translated.
- some sensors had the translation_key, but did not use the keys for status
- some sensors used values that were close to the translated keys, without conflict

Issue #1708
Jason Rumney 3 zile în urmă
părinte
comite
31daefa591

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

@@ -42,6 +42,7 @@ entities:
   - entity: sensor
     name: Connection state
     class: enum
+    translation_key: status
     icon: "mdi:ev-plug-type2"
     category: diagnostic
     dps:
@@ -51,7 +52,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -61,9 +62,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
       - id: 3
         type: string
         name: unknown_3

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

@@ -120,6 +120,7 @@ entities:
     name: Connection
     icon: "mdi:ev-plug-type2"
     class: enum
+    translation_key: status
     category: diagnostic
     dps:
       - id: 13  # connection_state
@@ -127,7 +128,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -137,9 +138,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
 
   # Charging mode
   - entity: select

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

@@ -121,6 +121,7 @@ entities:
     name: Connection
     icon: "mdi:ev-plug-type2"
     class: enum
+    translation_key: status
     category: diagnostic
     dps:
       - id: 13  # connection_state
@@ -128,7 +129,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -138,9 +139,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
 
   # Charging mode
   - entity: select

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

@@ -150,6 +150,7 @@ entities:
     name: Connection
     icon: "mdi:ev-plug-type2"
     class: enum
+    translation_key: status
     category: diagnostic
     dps:
       - id: 13    # connection_state
@@ -157,7 +158,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -167,9 +168,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config

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

@@ -103,6 +103,7 @@ entities:
     name: Connection
     icon: "mdi:ev-plug-type2"
     class: enum
+    translation_key: status
     category: diagnostic
     dps:
       - id: 13  # connection_state
@@ -110,7 +111,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -120,9 +121,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config

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

@@ -197,6 +197,7 @@ entities:
     name: Connection
     icon: "mdi:ev-plug-type2"
     class: enum
+    translation_key: status
     category: diagnostic
     dps:
       - id: 13
@@ -204,7 +205,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -214,9 +215,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config

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

@@ -20,6 +20,7 @@ entities:
           max: 12
   - entity: sensor
     name: Feed status
+    translation_key: status
     icon: "mdi:paw"
     class: enum
     dps:
@@ -28,9 +29,9 @@ entities:
         type: string
         mapping:
           - dps_val: standby
-            value: Standby
+            value: standby
           - dps_val: feeding
-            value: Feeding
+            value: feeding
   - entity: button
     translation_key: factory_reset
     category: config

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

@@ -8,13 +8,14 @@ entities:
     class: enum
     category: diagnostic
     name: Charge mode
+    translation_key: status
     dps:
       - id: 101
         type: string
         name: sensor
         mapping:
           - dps_val: mode_1
-            value: Standby
+            value: standby
           - dps_val: mode_2
             value: Constant current
           - dps_val: mode_3

+ 9 - 9
custom_components/tuya_local/devices/minib_public_litterbox.yaml

@@ -134,35 +134,35 @@ entities:
         name: sensor
         mapping:
           - dps_val: "Standby"
-            value: Standby
+            value: standby
           - dps_val: "Wait_Cluster"
-            value: Waiting for clumping
+            value: caking
           - dps_val: "Clean_Pause"
             value: Cleaning paused
           - dps_val: "Clean_Start"
             value: Starting cleaning
           - dps_val: "Cleaning"
-            value: Cleaning
+            value: cleaning
           - dps_val: "Empty_Pause"
             value: Emptying paused
           - dps_val: "Empty_Start"
             value: Starting emptying
           - dps_val: "Emptying"
-            value: Emptying
+            value: emptying
           - dps_val: "Reset_Pause"
             value: Reset paused
           - dps_val: "Reset_Start"
             value: Starting reset
           - dps_val: "Resetting"
-            value: Resetting
+            value: resetting
           - dps_val: "Abnormal"
-            value: Abnormal
+            value: fault
           - dps_val: "Reverse_rotation"
-            value: Reverse rotation
+            value: reverse
           - dps_val: "Drawers_open"
-            value: Drawer open
+            value: door_open
           - dps_val: "Cat_into"
-            value: Cat detected
+            value: occupied
 
   - entity: select
     name: Weight unit

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

@@ -27,17 +27,18 @@ entities:
     name: Feed state
     icon: "mdi:valve"
     class: enum
+    translation_key: status
     dps:
       - id: 4
         name: sensor
         type: string
         mapping:
           - dps_val: standby
-            value: Standby
+            value: standby
           - dps_val: feeding
-            value: Feeding
+            value: feeding
           - dps_val: done
-            value: Done
+            value: done
   - entity: number
     translation_key: manual_feed
     category: config

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

@@ -27,17 +27,18 @@ entities:
     name: Feed state
     icon: "mdi:valve"
     class: enum
+    translation_key: status
     dps:
       - id: 4
         name: sensor
         type: string
         mapping:
           - dps_val: standby
-            value: Standby
+            value: standby
           - dps_val: feeding
-            value: Feeding
+            value: feeding
           - dps_val: done
-            value: Done
+            value: done
   - entity: number
     translation_key: manual_feed
     category: config

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

@@ -146,13 +146,14 @@ entities:
     class: enum
     icon: "mdi:ev-plug-type2"
     category: diagnostic
+    translation_key: status
     dps:
       - id: 13
         type: string
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -162,9 +163,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config

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

@@ -201,13 +201,14 @@ entities:
     name: Connection
     icon: "mdi:ev-plug-type2"
     class: enum
+    translation_key: status
     dps:
       - id: 13  # connection_state
         type: string
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -217,9 +218,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config

+ 3 - 3
custom_components/tuya_local/devices/ti_pro25_catlitterbox.yaml

@@ -106,17 +106,17 @@ entities:
           - dps_val: "clean"
             value: "cleaning"
           - dps_val: "empty"
-            value: "emptying litter"
+            value: "emptying"
           - dps_val: "clock"
             value: "child lock"
           - dps_val: "sleep"
-            value: "sleep mode"
+            value: "sleep"
           - dps_val: "level"
             value: "smoothing"
           - dps_val: "test"
             value: "self check"
           - dps_val: "replace"
-            value: "replacing bag"
+            value: "full"
   - entity: button
     name: Clean
     icon: "mdi:shimmer"

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

@@ -140,6 +140,7 @@ entities:
     name: Connection state
     class: enum
     icon: "mdi:ev-plug-type2"
+    translation_key: status
     category: diagnostic
     dps:
       - id: 13
@@ -147,7 +148,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -157,9 +158,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config

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

@@ -145,6 +145,7 @@ entities:
   - entity: sensor
     name: Connection state
     class: enum
+    translation_key: status
     icon: "mdi:ev-plug-type2"
     category: diagnostic
     dps:
@@ -153,7 +154,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwm
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -163,9 +164,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config

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

@@ -117,6 +117,7 @@ entities:
     name: Connection state
     class: enum
     icon: "mdi:ev-plug-type2"
+    translation_key: status
     category: diagnostic
     dps:
       - id: 13
@@ -124,7 +125,7 @@ entities:
         name: sensor
         mapping:
           - dps_val: controlpi_12v
-            value: Standby
+            value: standby
           - dps_val: controlpi_12v_pwn
             value: Communication initialising
           - dps_val: controlpi_9v
@@ -134,9 +135,9 @@ entities:
           - dps_val: controlpi_6v
             value: Ready to charge
           - dps_val: controlpi_6v_pwm
-            value: Charging
+            value: charging
           - dps_val: controlpi_error
-            value: Error
+            value: fault
   - entity: select
     translation_key: charging_mode
     category: config