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

feat: add translation for water_volume、electrolysis_sterilization and machine_separation_status

李余通 1 год назад
Родитель
Сommit
443844c641

+ 14 - 19
custom_components/tuya_local/devices/airx_h8_humidifier.yaml

@@ -38,23 +38,24 @@ primary_entity:
         - dps_val: SLEEP
           value: sleep
 secondary_entities:
-  - entity: alarm_control_panel
+  - entity: binary_sensor
     category: diagnostic
-    name: 机头分离告警
+    translation_key: machine_separation_status
     dps:
       - id: 22
         type: string
-        name: alarm_state
+        name: sensor
         mapping:
           - dps_val: 0
-            value: disarmed
+            value: off
           - dps_val: 1
-            value: armed
+            value: on
   - entity: switch
-    name: 除菌
+    translation_key: electrolysis_sterilization
+    category: config
     dps:
       - id: 21
-        type: integer
+        type: boolean
         name: switch
   - entity: switch
     translation_key: evaporator_cleaning
@@ -70,7 +71,6 @@ secondary_entities:
       - id: 102
         type: boolean
         name: switch
-  # tuya提供了面板灯光设置,但H8Pro实测不生效
   - entity: light
     translation_key: display
     category: config
@@ -86,7 +86,7 @@ secondary_entities:
         type: boolean
         name: switch
   - entity: sensor
-    name: 水位
+    translation_key: water_volume
     class: enum
     category: diagnostic
     dps:
@@ -95,20 +95,15 @@ secondary_entities:
         type: string
         mapping:
           - dps_val: No_water
-            value: "缺水"
-            icon: "mdi:water-off"
+            value: empty
           - dps_val: Low_water
-            value: "低水位"
-            icon: "mdi:water-minus"
+            value: low
           - dps_val: Middle_water
-            value: "中水位"
-            icon: "mdi:water-opacity"
+            value: middle
           - dps_val: High_water
-            value: "高水位"
-            icon: "mdi:water-plus"
+            value: high
           - dps_val: Full_water
-            value: "满水"
-            icon: "mdi:water"
+            value: full
   - entity: switch
     translation_key: ionizer
     dps:

+ 20 - 0
custom_components/tuya_local/icons.json

@@ -24,6 +24,13 @@
                 "state": {
                     "off": "mdi:weather-night"
                 }
+            },
+            "machine_separation_status": {
+                "default": "mdi:check-circle",
+                "state": {
+                    "on": "mdi:alert-circle",
+                    "off": "mdi:check-circle"
+                }
             }
         },
         "button": {
@@ -181,6 +188,16 @@
             "cooking_status": {
                 "default": "mdi:information-variant-circle"
             },
+            "water_volume": {
+                "default": "mdi:water",
+                "state": {
+                    "empty": "mdi:water-off",
+                    "low": "mdi:water-minus",
+                    "middle": "mdi:water-opacity",
+                    "high": "mdi:water-plus",
+                    "full": "mdi:water"
+                }
+            },
             "status": {
                 "default": "mdi:information-variant-circle",
                 "state": {
@@ -270,6 +287,9 @@
             },
             "uv_sterilization": {
                 "default": "mdi:sun-wireless"
+            },
+            "electrolysis_sterilization": {
+                "default": "mdi:flash"
             }
         }
     }

+ 20 - 0
custom_components/tuya_local/translations/en.json

@@ -143,6 +143,13 @@
                         }
                     }
                 }
+            },
+            "machine_separation_status": {
+                "name": "Machine Separation Status",
+                "state": {
+                  "off": "Normal",
+                  "on": "Separated"
+                }
             }
         },
         "button": {
@@ -618,6 +625,16 @@
                     "pause": "Cooking Paused"
                 }
             },
+            "water_volume": {
+                "name": "Water Volume",
+                "state": {
+                    "empty": "Empty",
+                    "low": "Low",
+                    "middle": "Middle",
+                    "high": "High",
+                    "full": "Full"
+                }
+            },
             "energy_produced": {
                 "name": "Energy produced"
             },
@@ -664,6 +681,9 @@
             },
             "uv_sterilization": {
                 "name": "UV sterilization"
+            },
+            "electrolysis_sterilization": {
+                "name": "Electrolysis sterilization"
             }
         }
     }

+ 20 - 0
custom_components/tuya_local/translations/zh-Hans.json

@@ -143,6 +143,13 @@
                         }
                     }
                 }
+            },
+            "machine_separation_status": {
+                "name": "机器分离状态",
+                "state": {
+                    "off": "正常",
+                    "on": "已分离"
+                }
             }
         },
         "button": {
@@ -618,6 +625,16 @@
                     "pause": "烹饪暂停"
                 }
             },
+            "water_volume": {
+                "name": "水量",
+                "state": {
+                    "empty": "空",
+                    "low": "低",
+                    "middle": "中",
+                    "high": "高",
+                    "full": "满"
+                }
+            },
             "energy_produced": {
                 "name": "产生的能量"
             },
@@ -664,6 +681,9 @@
             },
             "uv_sterilization": {
                 "name": "紫外线消毒"
+            },
+            "electrolysis_sterilization": {
+                "name": "电解消毒"
             }
         }
     }

+ 20 - 0
custom_components/tuya_local/translations/zh-Hant.json

@@ -143,6 +143,13 @@
                         }
                     }
                 }
+            },
+            "machine_separation_status": {
+                "name": "機器分離狀態",
+                "state": {
+                    "off": "正常",
+                    "on": "已分離"
+                }
             }
         },
         "button": {
@@ -619,6 +626,16 @@
                     "pause": "烹飪暫停"
                 }
             },
+            "water_volume": {
+                "name": "水量",
+                "state": {
+                    "empty": "空",
+                    "low": "低",
+                    "middle": "中",
+                    "high": "高",
+                    "full": "滿"
+                }
+            },
             "energy_produced": {
                 "name": "能量產生"
             },
@@ -665,6 +682,9 @@
             },
             "uv_sterilization": {
                 "name": "紫外線消毒"
+            },
+            "electrolysis_sterilization": {
+                "name": "電解消毒"
             }
         }
     }