4
0
Эх сурвалжийг харах

feat! (translations): add translation for sound switch

- rename "beep" switches to "sound"
- rename "mute" switches to "sound" and invert
- rename "mute_voice", "mute_sound", and "muffling" switches and invert

Issue #1708
Jason Rumney 4 өдөр өмнө
parent
commit
0ffbbdf4d1
89 өөрчлөгдсөн 248 нэмэгдсэн , 149 устгасан
  1. 30 0
      custom_components/tuya_local/__init__.py
  2. 1 1
      custom_components/tuya_local/config_flow.py
  3. 3 3
      custom_components/tuya_local/devices/alecoair_pu55_humino.yaml
  4. 1 2
      custom_components/tuya_local/devices/amantii-r12ap1-fireplace.yaml
  5. 6 3
      custom_components/tuya_local/devices/arcelik_ahphmm_comboheatpump.yaml
  6. 1 2
      custom_components/tuya_local/devices/atorch_at2pl_breaker.yaml
  7. 1 1
      custom_components/tuya_local/devices/atorch_s1bw_smartplug.yaml
  8. 1 1
      custom_components/tuya_local/devices/atorch_s1wp.yaml
  9. 1 2
      custom_components/tuya_local/devices/avatto_wt100_thermostat.yaml
  10. 4 5
      custom_components/tuya_local/devices/axen_ks100w_heatpump.yaml
  11. 1 2
      custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml
  12. 1 2
      custom_components/tuya_local/devices/beok_tgm50wp_thermostat.yaml
  13. 1 2
      custom_components/tuya_local/devices/beok_tol47_thermostat.yaml
  14. 1 1
      custom_components/tuya_local/devices/brokton_brst12_airconditioner.yaml
  15. 1 2
      custom_components/tuya_local/devices/bvf_cp1_heater.yaml
  16. 1 1
      custom_components/tuya_local/devices/catit_pixi_smart_feeder.yaml
  17. 1 1
      custom_components/tuya_local/devices/cecotec_congas1970_vacuum.yaml
  18. 1 2
      custom_components/tuya_local/devices/chanfok_ceiling_fanlight.yaml
  19. 1 2
      custom_components/tuya_local/devices/chanfok_fan_light.yaml
  20. 2 3
      custom_components/tuya_local/devices/cleanair_604b_humidifier.yaml
  21. 6 2
      custom_components/tuya_local/devices/clofte_duo_400_humidifier.yaml
  22. 1 2
      custom_components/tuya_local/devices/cooper_hunter_air_conditioner.yaml
  23. 1 1
      custom_components/tuya_local/devices/daizuki_heatpump.yaml
  24. 1 1
      custom_components/tuya_local/devices/depuley_smart_ceiling_fan.yaml
  25. 1 2
      custom_components/tuya_local/devices/djive_arc_fan.yaml
  26. 1 2
      custom_components/tuya_local/devices/earu_k6h3aw_thermostat.yaml
  27. 1 1
      custom_components/tuya_local/devices/eeese_thor_dehumidifier.yaml
  28. 6 2
      custom_components/tuya_local/devices/fiesta_dk1g_kettle.yaml
  29. 1 1
      custom_components/tuya_local/devices/fujicool_yuzu_heatpump.yaml
  30. 6 2
      custom_components/tuya_local/devices/goldair_gpoc2415_oilheater.yaml
  31. 6 2
      custom_components/tuya_local/devices/gzair_radon_gas_detector.yaml
  32. 6 2
      custom_components/tuya_local/devices/haier_nayun_gasalarm.yaml
  33. 1 2
      custom_components/tuya_local/devices/hiper_bladeless_fan.yaml
  34. 1 1
      custom_components/tuya_local/devices/hyd_weair_plus_fan.yaml
  35. 6 2
      custom_components/tuya_local/devices/kabum_smart500_vacuum.yaml
  36. 1 2
      custom_components/tuya_local/devices/kesser_infrared_wall_heater.yaml
  37. 1 2
      custom_components/tuya_local/devices/keyun_rgb_ceilingfan.yaml
  38. 1 1
      custom_components/tuya_local/devices/klarstein_airfold_fanlight.yaml
  39. 1 2
      custom_components/tuya_local/devices/kogan_bladeless_fan.yaml
  40. 1 6
      custom_components/tuya_local/devices/lexy_f501_fan.yaml
  41. 1 2
      custom_components/tuya_local/devices/livn_arosa_fireplace.yaml
  42. 1 12
      custom_components/tuya_local/devices/lumary_a1_ceilingfanlight.yaml
  43. 1 2
      custom_components/tuya_local/devices/lumary_b2_ceilingfanlight.yaml
  44. 6 2
      custom_components/tuya_local/devices/miro_qtower_humidifier.yaml
  45. 1 1
      custom_components/tuya_local/devices/oscal_powermax6000_portablepower.yaml
  46. 1 2
      custom_components/tuya_local/devices/petoneer_nutri_pet_feeder.yaml
  47. 1 1
      custom_components/tuya_local/devices/petree_cube_litter_box.yaml
  48. 6 2
      custom_components/tuya_local/devices/prodotec_airquality_monitor.yaml
  49. 6 2
      custom_components/tuya_local/devices/proscenic_m9_vacuum.yaml
  50. 1 1
      custom_components/tuya_local/devices/rotenso_ronix_heatpump.yaml
  51. 1 2
      custom_components/tuya_local/devices/royalclima_fresh_climate.yaml
  52. 6 2
      custom_components/tuya_local/devices/rq400a_gasalarm.yaml
  53. 1 2
      custom_components/tuya_local/devices/smart_siren_alarm.yaml
  54. 1 1
      custom_components/tuya_local/devices/smartmi_air_circulator_fan.yaml
  55. 1 1
      custom_components/tuya_local/devices/smartmi_air_purifier_p1.yaml
  56. 4 3
      custom_components/tuya_local/devices/smoke_detector.yaml
  57. 1 2
      custom_components/tuya_local/devices/sonninkonig_eco_elegance_heater.yaml
  58. 6 2
      custom_components/tuya_local/devices/tesla_s300_purifier.yaml
  59. 6 2
      custom_components/tuya_local/devices/wdyk_2p63a_energy_meter.yaml
  60. 6 2
      custom_components/tuya_local/devices/wdyk_4p100a_energymeter.yaml
  61. 1 7
      custom_components/tuya_local/devices/wetair_wawh1210lw_humidifier.yaml
  62. 1 6
      custom_components/tuya_local/devices/wilfa_haze_hu400bc_humidifier.yaml
  63. 1 2
      custom_components/tuya_local/devices/windcalm_fan.yaml
  64. 1 2
      custom_components/tuya_local/devices/windcalm_fan_with_light.yaml
  65. 1 10
      custom_components/tuya_local/devices/yx316wifi_aroma_diffuser.yaml
  66. 6 0
      custom_components/tuya_local/icons.json
  67. 3 0
      custom_components/tuya_local/translations/bg.json
  68. 3 0
      custom_components/tuya_local/translations/ca.json
  69. 3 0
      custom_components/tuya_local/translations/cz.json
  70. 3 0
      custom_components/tuya_local/translations/de.json
  71. 3 0
      custom_components/tuya_local/translations/el.json
  72. 3 0
      custom_components/tuya_local/translations/en.json
  73. 3 0
      custom_components/tuya_local/translations/es.json
  74. 3 0
      custom_components/tuya_local/translations/fr.json
  75. 3 0
      custom_components/tuya_local/translations/hu.json
  76. 3 0
      custom_components/tuya_local/translations/id.json
  77. 3 0
      custom_components/tuya_local/translations/it.json
  78. 3 0
      custom_components/tuya_local/translations/ja.json
  79. 3 0
      custom_components/tuya_local/translations/no-NB.json
  80. 3 0
      custom_components/tuya_local/translations/pl.json
  81. 3 0
      custom_components/tuya_local/translations/pt-BR.json
  82. 3 0
      custom_components/tuya_local/translations/pt-PT.json
  83. 3 0
      custom_components/tuya_local/translations/ro.json
  84. 3 0
      custom_components/tuya_local/translations/ru.json
  85. 3 0
      custom_components/tuya_local/translations/sv.json
  86. 3 0
      custom_components/tuya_local/translations/uk.json
  87. 3 0
      custom_components/tuya_local/translations/ur.json
  88. 3 0
      custom_components/tuya_local/translations/zh-Hans.json
  89. 3 0
      custom_components/tuya_local/translations/zh-Hant.json

+ 30 - 0
custom_components/tuya_local/__init__.py

@@ -787,6 +787,36 @@ async def async_migrate_entry(hass, entry: ConfigEntry):
 
         await async_migrate_entries(hass, entry.entry_id, update_unique_id13_15)
         hass.config_entries.async_update_entry(entry, minor_version=15)
+    if entry.version == 13 and entry.minor_version < 16:
+        # Migrate unique ids of existing entities to new id taking into
+        # account translation_key, and standardising naming
+        device_id = get_device_unique_id(entry)
+        conf_file = await hass.async_add_executor_job(
+            get_config,
+            entry.data[CONF_TYPE],
+        )
+        if conf_file is None:
+            _LOGGER.error(
+                NOT_FOUND,
+                entry.data[CONF_TYPE],
+            )
+            return False
+
+        @callback
+        def update_unique_id13_16(entity_entry):
+            """Update the unique id of an entity entry."""
+            # Standardistion of entity naming to use translation_key
+            replacements = {
+                "switch_beep": "switch_sound",
+                "switch_mute": "switch_sound",
+                "switch_muffling": "switch_sound",
+                "switch_mute_sound": "switch_sound",
+                "switch_mute_voice": "switch_sound",
+            }
+            return replace_unique_ids(entity_entry, device_id, conf_file, replacements)
+
+        await async_migrate_entries(hass, entry.entry_id, update_unique_id13_16)
+        hass.config_entries.async_update_entry(entry, minor_version=16)
     return True
 
 

+ 1 - 1
custom_components/tuya_local/config_flow.py

@@ -51,7 +51,7 @@ DEVICE_DETAILS_URL = (
 
 class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
     VERSION = 13
-    MINOR_VERSION = 15
+    MINOR_VERSION = 16
     CONNECTION_CLASS = CONN_CLASS_LOCAL_PUSH
     device = None
     data = {}

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

@@ -105,7 +105,7 @@ entities:
         type: boolean
 
   - entity: switch
-    name: Mute
+    translation_key: sound
     category: config
     dps:
       - id: 28
@@ -113,9 +113,9 @@ entities:
         type: boolean
         mapping:
           - dps_val: true
-            icon: mdi:volume-variant-off
+            value: false
           - dps_val: false
-            icon: mdi:volume-medium
+            value: true
 
   - entity: light
     translation_key: display

+ 1 - 2
custom_components/tuya_local/devices/amantii-r12ap1-fireplace.yaml

@@ -147,8 +147,7 @@ entities:
           - dps_val: 36C_96F_97F
             value: 36
   - entity: switch
-    name: Sound
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 101

+ 6 - 3
custom_components/tuya_local/devices/arcelik_ahphmm_comboheatpump.yaml

@@ -254,14 +254,17 @@ entities:
         name: switch
 
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-off"
+    translation_key: sound
     category: config
     dps:
       - id: 101
         type: boolean
         name: switch
-
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   # BINARY SENSOR ENTİTELERİ
   - entity: binary_sensor
     class: problem

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

@@ -173,8 +173,7 @@ entities:
           min: 3
           max: 99
   - entity: switch
-    name: Beep
-    icon: "mdi:bell"
+    translation_key: sound
     category: config
     dps:
       - id: 111

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

@@ -178,7 +178,7 @@ entities:
           min: 3
           max: 99
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 111

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

@@ -167,7 +167,7 @@ entities:
           min: 3
           max: 99
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 111

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

@@ -70,9 +70,8 @@ entities:
         name: lock
         type: boolean
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
-    icon: "mdi:music-note"
     dps:
       - id: 13
         type: boolean

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

@@ -31,18 +31,17 @@ entities:
         optional: true
         name: fault_flag
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
-    icon_priority: 2
+    translation_key: sound
     category: config
     dps:
       - id: 101
         type: boolean
         name: switch
         mapping:
+          - dps_val: true
+            value: false
           - dps_val: false
-            icon: "mdi:volume-high"
-            icon_priority: 1
+            value: true
   - entity: climate
     dps:
       - id: 1

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

@@ -213,9 +213,8 @@ entities:
           - dps_val: "3"
             value: Both
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
-    icon: "mdi:music-note"
     dps:
       - id: 109
         type: boolean

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

@@ -209,9 +209,8 @@ entities:
           - dps_val: "3"
             value: Both
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
-    icon: "mdi:music-note"
     dps:
       - id: 109
         type: boolean

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

@@ -60,9 +60,8 @@ entities:
         type: boolean
         name: lock
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
-    icon: "mdi:music-note"
     dps:
       - id: 13
         type: boolean

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

@@ -211,7 +211,7 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 16

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

@@ -54,8 +54,7 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Beep
-    icon: "mdi:bell"
+    translation_key: sound
     category: config
     dps:
       - id: 7

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

@@ -164,7 +164,7 @@ entities:
         # Present at all times on Catit 43752 but unsure about other products
         optional: true
   - entity: switch
-    name: Sound enabled
+    translation_key: sound
     category: config
     dps:
       - id: 103

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

@@ -300,7 +300,7 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
     dps:
       - id: 112

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

@@ -62,8 +62,7 @@ entities:
         name: value
         optional: true
   - entity: switch
-    name: Beep
-    icon: "mdi:bell"
+    translation_key: sound
     category: config
     dps:
       - id: 101

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

@@ -61,8 +61,7 @@ entities:
         type: string
         optional: true
   - entity: switch
-    name: Beep
-    icon: "mdi:bell"
+    translation_key: sound
     category: config
     dps:
       - id: 66

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

@@ -34,8 +34,7 @@ entities:
           - dps_val: sleep
             value: sleep
   - entity: switch
-    name: Sound
-    icon: mdi:volume-high
+    translation_key: sound
     dps:
       - id: 8
         name: switch
@@ -101,7 +100,7 @@ entities:
           - value: false
   - entity: binary_sensor
     name: Water tank overflow
-    icon: mdi:liquid-spot
+    icon: "mdi:liquid-spot"
     class: problem
     category: diagnostic
     dps:

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

@@ -56,12 +56,16 @@ entities:
         name: switch
         type: boolean
   - entity: switch
-    name: Mute
-    icon: mdi:volume-mute
+    translation_key: sound
     dps:
       - id: 116
         name: switch
         type: boolean
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: switch
     name: Drying
     dps:

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

@@ -188,9 +188,8 @@ entities:
         name: lock
         type: boolean
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
-    icon: "mdi:bell"
     dps:
       - id: 16
         name: switch

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

@@ -273,7 +273,7 @@ entities:
         name: switch
         mask: "0008"
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 123

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

@@ -337,7 +337,7 @@ entities:
         name: fault_code
   - entity: switch
     category: config
-    name: Beep
+    translation_key: sound
     dps:
       - id: 57
         name: switch

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

@@ -73,8 +73,7 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Sound
-    icon: "mdi:volume-high"
+    translation_key: sound
     dps:
       - id: 13
         type: boolean

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

@@ -255,8 +255,7 @@ entities:
             value: false
           - value: true
   - entity: switch
-    name: Sound
-    icon: "mdi:ear-hearing"
+    translation_key: sound
     category: config
     hidden: unavailable
     dps:

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

@@ -161,7 +161,7 @@ entities:
             value: true
           - value: false
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 101

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

@@ -313,11 +313,15 @@ entities:
         optional: true
         name: switch
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 102
         type: boolean
         optional: true
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true

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

@@ -220,7 +220,7 @@ entities:
         name: switch
         mask: "0008"
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 123

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

@@ -87,13 +87,17 @@ entities:
         name: fault_code
 
   - entity: switch
-    name: Mute
+    translation_key: sound
     category: config
     dps:
       - id: 101
         type: boolean
         name: switch
-
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: number
     name: On timer
     translation_key: timer

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

@@ -107,13 +107,17 @@ entities:
         type: boolean
         name: sensor
   - entity: switch
-    name: Muffling
-    icon: "mdi:alarm"
+    translation_key: sound
     category: config
     dps:
       - id: 16
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: sensor
     name: Detection value
     dps:

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

@@ -113,10 +113,14 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 16
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true

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

@@ -102,8 +102,7 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Sound
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 102

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

@@ -129,7 +129,7 @@ entities:
         optional: true
         name: fault_code
   - entity: switch
-    name: Beep
+    translation_key: sound
     dps:
       - id: 102
         type: boolean

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

@@ -118,12 +118,16 @@ entities:
         unit: "%"
         class: measurement
   - entity: switch
-    name: Mute voice
-    icon: "mdi:account-voice"
+    translation_key: sound
     dps:
       - id: 31
         type: boolean
         name: switch
+        mapping:
+          - dps_val: false
+            value: true
+          - dps_val: true
+            value: false
   - entity: sensor
     name: Clean area
     class: area

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

@@ -60,9 +60,8 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
-    icon: "mdi:music-note"
     dps:
       - id: 103
         type: boolean

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

@@ -241,8 +241,7 @@ entities:
         name: sensor
         unit: min
   - entity: switch
-    name: Beep
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 103

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

@@ -36,7 +36,7 @@ entities:
         optional: true
         name: oscillate
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 107

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

@@ -60,8 +60,7 @@ entities:
         type: boolean
         name: oscillate
   - entity: switch
-    name: Sound
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 102

+ 1 - 6
custom_components/tuya_local/devices/lexy_f501_fan.yaml

@@ -63,17 +63,12 @@ entities:
         name: lock
         type: boolean
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
     dps:
       - id: 17
         name: switch
         type: boolean
-        mapping:
-          - dps_val: true
-            icon: "mdi:volume-high"
-          - dps_val: false
-            icon: "mdi:volume-mute"
   - entity: number
     translation_key: timer
     class: duration

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

@@ -281,8 +281,7 @@ entities:
             value: "14"
 
   - entity: switch
-    name: Sound
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 112

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

@@ -178,30 +178,19 @@ entities:
         type: boolean
         name: available
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
-    icon: "mdi:volume-high"
     dps:
       - id: 66
         type: boolean
         optional: true
         name: switch
         mapping:
-          - dps_val: false
-            icon: "mdi:volume-off"
-            icon_priority: 1
-          - dps_val: true
-            icon: "mdi:volume-high"
-            icon_priority: 1
           - dps_val: null
             value_redirect: alt
       - id: 103
         type: boolean
         name: alt
-        mapping:
-          - dps_val: false
-            icon: "mdi:volume-off"
-            icon_priority: 2
   - entity: text
     name: Segment dimming
     category: config

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

@@ -128,8 +128,7 @@ entities:
         type: string
         name: direction
   - entity: switch
-    name: Beep
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 103

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

@@ -125,13 +125,17 @@ entities:
           - dps_val: middle
             value: high
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 103
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: light
     translation_key: nightlight
     dps:

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

@@ -94,7 +94,7 @@ entities:
           - dps_val: f
             value: fahrenheit
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 25

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

@@ -89,8 +89,7 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Beep
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 103

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

@@ -73,7 +73,7 @@ entities:
           min: 0
           max: 1439
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 108

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

@@ -60,13 +60,17 @@ entities:
         unit: ugm3
         class: measurement
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 102
         type: boolean
         name: switch
+        mapping:
+          - dps_val: false
+            value: true
+          - dps_val: true
+            value: false
   - entity: light
     translation_key: display
     category: config

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

@@ -467,13 +467,17 @@ entities:
         name: switch
         type: boolean
   - entity: switch
-    name: Mute sound
+    translation_key: sound
     category: config
-    icon: "mdi:volume-mute"
     dps:
       - id: 131
         name: switch
         type: boolean
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: switch
     name: Mop rotation
     icon: "mdi:rotate-360"

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

@@ -206,7 +206,7 @@ entities:
         name: switch
         mask: "0008"
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 123

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

@@ -252,9 +252,8 @@ entities:
         name: switch
         mask: "0080"
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
-    icon: "mdi:access-point"
     dps:
       - id: 123
         type: hex

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

@@ -74,10 +74,14 @@ entities:
         type: boolean
         name: sensor
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 14
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true

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

@@ -132,9 +132,8 @@ entities:
           - dps_val: "3"
             value: "high"
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
-    icon: "mdi:bullhorn-outline"
     dps:
       - id: 121
         type: boolean

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

@@ -121,7 +121,7 @@ entities:
   # Misc
   # -------------------------------------------------------
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 13

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

@@ -101,7 +101,7 @@ entities:
         type: boolean
 
   - entity: switch
-    name: Beep
+    translation_key: sound
     category: config
     dps:
       - id: 101

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

@@ -47,15 +47,16 @@ entities:
         type: string
         name: level
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
+    translation_key: sound
     dps:
       - id: 16
         type: boolean
         name: switch
         mapping:
+          - dps_val: true
+            value: false
           - dps_val: false
-            icon: "mdi:volume-high"
+            value: true
   - entity: button
     name: Test
     category: config

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

@@ -119,8 +119,7 @@ entities:
           min: -5
           max: 5
   - entity: switch
-    name: Beep
-    icon: "mdi:volume-high"
+    translation_key: sound
     category: config
     dps:
       - id: 103

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

@@ -144,13 +144,17 @@ entities:
         type: bitfield
         name: fault_code
   - entity: switch
-    name: Mute
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 104
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: light
     dps:
       - id: 105

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

@@ -331,13 +331,17 @@ entities:
           min: 10
           max: 100
   - entity: switch
-    name: Mute alarm
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 105
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: binary_sensor
     name: Earth leak
     class: safety

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

@@ -323,13 +323,17 @@ entities:
           min: 10
           max: 100
   - entity: switch
-    name: Mute alarm
-    icon: "mdi:volume-mute"
+    translation_key: sound
     category: config
     dps:
       - id: 105
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: binary_sensor
     name: Earth leak
     class: safety

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

@@ -39,18 +39,12 @@ entities:
         type: boolean
         name: switch
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
     dps:
       - id: 8
         name: "switch"
         type: boolean
-        mapping:
-          - dps_val: true
-            icon: "mdi:volume-high"
-          - dps_val: false
-            icon: "mdi:volume-off"
-
   - entity: sensor
     translation_key: water_level
     category: diagnostic

+ 1 - 6
custom_components/tuya_local/devices/wilfa_haze_hu400bc_humidifier.yaml

@@ -70,17 +70,12 @@ entities:
           - dps_val: false
             icon: "mdi:led-off"
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
     dps:
       - id: 8
         name: switch
         type: boolean
-        mapping:
-          - dps_val: true
-            icon: "mdi:volume-high"
-          - dps_val: false
-            icon: "mdi:volume-off"
   - entity: sensor
     class: temperature
     dps:

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

@@ -27,8 +27,7 @@ entities:
           min: 0
           max: 540
   - entity: switch
-    name: Beep
-    icon: "mdi:bell"
+    translation_key: sound
     category: config
     dps:
       - id: 66

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

@@ -49,8 +49,7 @@ entities:
           min: 0
           max: 540
   - entity: switch
-    name: Beep
-    icon: "mdi:bell"
+    translation_key: sound
     category: config
     dps:
       - id: 66

+ 1 - 10
custom_components/tuya_local/devices/yx316wifi_aroma_diffuser.yaml

@@ -78,22 +78,13 @@ entities:
               min: 0
               max: 255
   - entity: switch
-    name: Sound
+    translation_key: sound
     category: config
     dps:
       - id: 6
         type: boolean
         name: switch
         optional: true
-        mapping:
-          - dps_val: true
-            icon: "mdi:speaker"
-          - dps_val: false
-            icon: "mdi:speaker-off"
-          - dps_val: null
-            icon: "mdi:speaker-off"
-            value: false
-            hidden: true
   - entity: binary_sensor
     class: problem
     category: diagnostic

+ 6 - 0
custom_components/tuya_local/icons.json

@@ -601,6 +601,12 @@
             "sleep": {
                 "default": "mdi:power-sleep"
             },
+            "sound": {
+                "default": "mdi:volume-high",
+                "state": {
+                    "off": "mdi:volume-mute"
+                }
+            },
             "uv_sterilization": {
                 "default": "mdi:sun-wireless"
             }

+ 3 - 0
custom_components/tuya_local/translations/bg.json

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "Сън"
             },
+            "sound": {
+                "name": "Звук"
+            },
             "switch_x": {
                 "name": "Превключване {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/ca.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Dorm"
             },
+            "sound": {
+                "name": "Sonido"
+            },
             "switch_x": {
                 "name": "Interruptor {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/cz.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Spát"
             },
+            "sound": {
+                "name": "Zvuk"
+            },
             "switch_x": {
                 "name": "Přepínač {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/de.json

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "Schlafen"
             },
+            "sound": {
+                "name": "Ton"
+            },
             "switch_x": {
                 "name": "Schalter {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/el.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Αναμονή"
             },
+            "sound": {
+                "name": "Ήχος"
+            },
             "switch_x": {
                 "name": "Διακόπτης {x}"
             },

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

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Sleep"
             },
+            "sound": {
+                "name": "Sound"
+            },
             "switch_x": {
                 "name": "Switch {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/es.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Modo de suspensión"
             },
+            "sound": {
+                "name": "Sonido"
+            },
             "switch_x": {
                 "name": "Interruptor {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/fr.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Veille"
             },
+            "sound": {
+                "name": "Son"
+            },
             "switch_x": {
                 "name": "Interrupteur {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/hu.json

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "Alvás"
             },
+            "sound": {
+                "name": "Hang"
+            },
             "switch_x": {
                 "name": "Kapcsoló {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/id.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Tidur"
             },
+            "sound": {
+                "name": "Suara"
+            },
             "switch_x": {
                 "name": "Saklar {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/it.json

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "Sonno"
             },
+            "sound": {
+                "name": "Suono"
+            },
             "switch_x": {
                 "name": "Interruttore {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/ja.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "睡眠"
             },
+            "sound": {
+                "name": "サウンド"
+            },
             "switch_x": {
                 "name": "スイッチ{x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/no-NB.json

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "Søvnmodus"
             },
+            "sound": {
+                "name": "Lyd"
+            },
             "switch_x": {
                 "name": "Bryter {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/pl.json

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "Tryb uśpienia"
             },
+            "sound": {
+                "name": "Dźwięk"
+            },
             "switch_x": {
                 "name": "Przełącznik {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/pt-BR.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Dormir"
             },
+            "sound": {
+                "name": "Som"
+            },
             "switch_x": {
                 "name": "Interruptor {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/pt-PT.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Dormir"
             },
+            "sound": {
+                "name": "Som"
+            },
             "switch_x": {
                 "name": "Interruptor {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/ro.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Somn"
             },
+            "sound": {
+                "name": "Sunet"
+            },
             "switch_x": {
                 "name": "Comutator {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/ru.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Сон"
             },
+            "sound": {
+                "name": "Звук"
+            },
             "switch_x": {
                 "name": "Выключатель {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/sv.json

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "Sömn"
             },
+            "sound": {
+                "name": "Ljud"
+            },
             "switch_x": {
                 "name": "Brytare {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/uk.json

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "Сон"
             },
+            "sound": {
+                "name": "Звук"
+            },
             "switch_x": {
                 "name": "Вимикач {x}"
             },

+ 3 - 0
custom_components/tuya_local/translations/ur.json

@@ -1066,6 +1066,9 @@
             "sleep": {
                 "name": "سونا"
             },
+            "sound": {
+                "name": "آواز"
+            },
             "switch_x": {
                 "name": "سوئچ {x}"
             },

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

@@ -1063,6 +1063,9 @@
             "sleep": {
                 "name": "睡眠"
             },
+            "sound": {
+                "name": "声音"
+            },
             "switch_x": {
                 "name": "开关{x}"
             },

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

@@ -1064,6 +1064,9 @@
             "sleep": {
                 "name": "睡眠模式"
             },
+            "sound": {
+                "name": "聲音"
+            },
             "switch_x": {
                 "name": "開關{x}"
             },