Bläddra i källkod

fix(devices): fix type errors revealed by new tests

- Many unquoted strings that are interpreted as integer (probably work
  ok for now, but fragile against future changes if not fixed.
- some incorrect types defined due to entity templates (mostly
  binary_sensor defined as boolean where it is actually string or
  bitfield)
- some incorrect values used, especially where users are confused over
  the Tuya documentation for bitmap types.
- user tricks to use dummy mappings to make redirected options
  visible, with incompatible type for the dummy entry.
Jason Rumney 17 timmar sedan
förälder
incheckning
c7b6158fb3
47 ändrade filer med 235 tillägg och 324 borttagningar
  1. 2 2
      custom_components/tuya_local/devices/airx_h8_humidifier.yaml
  2. 1 1
      custom_components/tuya_local/devices/arcelik_ahphmm_comboheatpump.yaml
  3. 3 3
      custom_components/tuya_local/devices/avatto_wt20r_thermostat.yaml
  4. 3 3
      custom_components/tuya_local/devices/avatto_wt20rv2_thermostat.yaml
  5. 4 4
      custom_components/tuya_local/devices/brade_mc6_thermostat.yaml
  6. 4 4
      custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml
  7. 3 18
      custom_components/tuya_local/devices/casdon_16j3s_dishwasher.yaml
  8. 3 26
      custom_components/tuya_local/devices/casdon_t2e_oven.yaml
  9. 3 3
      custom_components/tuya_local/devices/colemanmach_rvp9420_thermostat.yaml
  10. 3 3
      custom_components/tuya_local/devices/djive_arc_fan.yaml
  11. 5 5
      custom_components/tuya_local/devices/dream_maker_feel_fan.yaml
  12. 1 1
      custom_components/tuya_local/devices/duracomfort_dh50pwm_dehumidifier.yaml
  13. 2 2
      custom_components/tuya_local/devices/ecostrad_iqceramic_radiator.yaml
  14. 1 2
      custom_components/tuya_local/devices/em3378_weather_station.yaml
  15. 3 3
      custom_components/tuya_local/devices/essentials_smart_electric_heater.yaml
  16. 18 18
      custom_components/tuya_local/devices/fancyled_fpgahdmi2_light.yaml
  17. 3 3
      custom_components/tuya_local/devices/faroro_pettreat_camera.yaml
  18. 5 5
      custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml
  19. 1 1
      custom_components/tuya_local/devices/frizzlife_lp365p_watermonitorandshutdoff.yaml
  20. 10 10
      custom_components/tuya_local/devices/gratkit_filament_dryer.yaml
  21. 18 18
      custom_components/tuya_local/devices/hdmi_sync_light.yaml
  22. 8 8
      custom_components/tuya_local/devices/holman_wx1_taptimer.yaml
  23. 15 15
      custom_components/tuya_local/devices/holman_wx2_taptimer.yaml
  24. 5 5
      custom_components/tuya_local/devices/honeywell_air_touch_p2.yaml
  25. 25 21
      custom_components/tuya_local/devices/kcvents_vt501_fan.yaml
  26. 8 8
      custom_components/tuya_local/devices/klarta_forste4_purifier.yaml
  27. 8 8
      custom_components/tuya_local/devices/kogan_air_purifier.yaml
  28. 3 3
      custom_components/tuya_local/devices/loratap_relay.yaml
  29. 0 52
      custom_components/tuya_local/devices/madimack_inverflow_pro.yaml
  30. 3 3
      custom_components/tuya_local/devices/moes_threegang.yaml
  31. 10 10
      custom_components/tuya_local/devices/nac_ap470_purifier.yaml
  32. 4 4
      custom_components/tuya_local/devices/neatsvor_x600_vacuum.yaml
  33. 2 5
      custom_components/tuya_local/devices/nedis_outdoor_camera.yaml
  34. 1 1
      custom_components/tuya_local/devices/neptun_smartplus_waterleak.yaml
  35. 3 3
      custom_components/tuya_local/devices/nooie_pu13_smartplug.yaml
  36. 4 4
      custom_components/tuya_local/devices/powerworld_pw040_waterheatpump.yaml
  37. 1 1
      custom_components/tuya_local/devices/sboardiii_weigand_lock.yaml
  38. 4 4
      custom_components/tuya_local/devices/t5e_wf_thermostat.yaml
  39. 5 5
      custom_components/tuya_local/devices/termoplaza_panel_heater.yaml
  40. 1 1
      custom_components/tuya_local/devices/th08_temperature_and_humidity_sensor.yaml
  41. 16 16
      custom_components/tuya_local/devices/ustellar_ut99911_rgb.yaml
  42. 1 1
      custom_components/tuya_local/devices/vaco_mobyblue_heatpump.yaml
  43. 4 4
      custom_components/tuya_local/devices/vestfrost_vp_a1z40hw_purifier.yaml
  44. 1 1
      custom_components/tuya_local/devices/vjulesv_sk17_galaxyprojector.yaml
  45. 5 4
      custom_components/tuya_local/devices/weatherstationpro_weatherstation.yaml
  46. 1 1
      custom_components/tuya_local/devices/zemismart_spm02v25_energymeter.yaml
  47. 1 1
      custom_components/tuya_local/devices/zigbee_zth08ztu_temphumid_sensor.yaml

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

@@ -41,9 +41,9 @@ entities:
         type: string
         name: sensor
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: false
-          - dps_val: 1
+          - dps_val: "1"
             value: true
   - entity: switch
     translation_key: electrolytic_sterilization

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

@@ -142,7 +142,7 @@ entities:
         type: boolean
         name: available
       - id: 109
-        type: boolean
+        type: string
         name: operation_mode
         mapping:
           - dps_val: hot_water

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

@@ -97,11 +97,11 @@ entities:
         optional: true
         name: option
         mapping:
-          - dps_val: 5_2
+          - dps_val: "5_2"
             value: Weekdays+Weekend
-          - dps_val: 6_1
+          - dps_val: "6_1"
             value: Mon-Sat+Sun
-          - dps_val: 7
+          - dps_val: "7"
             value: Daily
   - entity: binary_sensor
     name: Manual override

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

@@ -99,11 +99,11 @@ entities:
         optional: true
         name: option
         mapping:
-          - dps_val: 5_2
+          - dps_val: "5_2"
             value: Weekdays+Weekend
-          - dps_val: 6_1
+          - dps_val: "6_1"
             value: Mon-Sat+Sun
-          - dps_val: 7
+          - dps_val: "7"
             value: Daily
   - entity: binary_sensor
     name: Manual override

+ 4 - 4
custom_components/tuya_local/devices/brade_mc6_thermostat.yaml

@@ -244,11 +244,11 @@ entities:
         mapping:
           - dps_val: offf
             value: "Off"
-          - dps_val: 5_2
+          - dps_val: "5_2"
             value: Weekday+Weekend
-          - dps_val: 7day
+          - dps_val: "7day"
             value: "7 days"
-          - dps_val: 24hour
+          - dps_val: "24hour"
             value: "24 hours"
   - entity: select
     name: Temperature hysteresis
@@ -259,7 +259,7 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0_5
+          - dps_val: "0_5"
             value: "0.5"
           - dps_val: "1"
             value: "1"

+ 4 - 4
custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml

@@ -16,13 +16,13 @@ entities:
         name: mode
         type: string
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: "auto"
-          - dps_val: 1
+          - dps_val: "1"
             value: "boost"
-          - dps_val: 2
+          - dps_val: "2"
             value: "laundry"
-          - dps_val: 3
+          - dps_val: "3"
             value: "purify"
       - id: 4
         name: humidity

+ 3 - 18
custom_components/tuya_local/devices/casdon_16j3s_dishwasher.yaml

@@ -124,24 +124,9 @@ entities:
         type: bitfield
         name: sensor
         mapping:
-          - dps_val: e1
-            value: no_water
-          - dps_val: e2
-            value: drain_blocked
-          - dps_val: e3
-            value: overflow
-          - dps_val: e4
-            value: sensor_fault
-          - dps_val: e5
-            value: communication_fault
-          - dps_val: e6
-            value: heating_fault
-          - dps_val: e7
-            value: variable_frequency_fault
-          - dps_val: e8
-            value: valve_fault
-          - dps_val: e9
-            value: washing_motor_fault
+          - dps_val: 0
+            value: false
+          - value: true
   - entity: lock
     translation_key: child_lock
     category: config

+ 3 - 26
custom_components/tuya_local/devices/casdon_t2e_oven.yaml

@@ -278,29 +278,6 @@ entities:
         type: bitfield
         name: sensor
         mapping:
-          - dps_val: e01
-            value: chamber_overheat
-          - dps_val: e02
-            value: evaporation_tray_overheat
-          - dps_val: e03
-            value: chamber_low_temperature
-          - dps_val: e04
-            value: evaporation_tray_low_temperature
-          - dps_val: e05
-            value: sensor_open_circuit
-          - dps_val: e06
-            value: sensor_short_circuit
-          - dps_val: e07
-            value: communication_error
-          - dps_val: e08
-            value: receive_error
-          - dps_val: e09
-            value: transmit_error
-          - dps_val: e10
-            value: gas_leak
-          - dps_val: e11
-            value: fire
-          - dps_val: e12
-            value: firewall_sensor_fault
-          - dps_val: e13
-            value: valve_fault
+          - dps_val: 0
+            value: false
+          - value: true

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

@@ -182,11 +182,11 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 7_4
+          - dps_val: "7_4"
             value: Daily
-          - dps_val: 5_2
+          - dps_val: "5_2"
             value: Weekdays+Weekend
-          - dps_val: 5_1_1
+          - dps_val: "5_1_1"
             value: Weekdays+Sat+Sun
   - entity: select
     name: System type

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

@@ -44,11 +44,11 @@ entities:
         mapping:
           - dps_val: close
             value: "off"
-          - dps_val: 1
+          - dps_val: "1"
             value: low
-          - dps_val: 2
+          - dps_val: "2"
             value: medium
-          - dps_val: 3
+          - dps_val: "3"
             value: high
           - dps_val: auto
             value: auto

+ 5 - 5
custom_components/tuya_local/devices/dream_maker_feel_fan.yaml

@@ -39,15 +39,15 @@ entities:
         name: option
         type: string
         mapping:
-          - dps_val: 30
+          - dps_val: "30"
             value: "30°"
-          - dps_val: 60
+          - dps_val: "60"
             value: "60°"
-          - dps_val: 90
+          - dps_val: "90"
             value: "90°"
-          - dps_val: 120
+          - dps_val: "120"
             value: "120°"
-          - dps_val: 140
+          - dps_val: "140"
             value: "140°"
   - entity: switch
     translation_key: keytone

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

@@ -65,7 +65,7 @@ entities:
     category: diagnostic
     dps:
       - id: 15
-        type: boolean
+        type: bitfield
         name: sensor
         mapping:
           - dps_val: 32

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

@@ -98,10 +98,10 @@ entities:
         type: string
         name: switch
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: true
             icon: "mdi:sync"
-          - dps_val: 0
+          - dps_val: "0"
             value: false
             icon: "mdi:sync-off"
   - entity: number

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

@@ -145,10 +145,9 @@ entities:
     category: diagnostic
     dps:
       - id: 117
-        type: boolean
+        type: bitfield
         name: sensor
         optional: true
-        persist: false
         mapping:
           - dps_val: null
             value: false

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

@@ -70,12 +70,12 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: "Off"
             icon: "mdi:window-closed"
-          - dps_val: 60
+          - dps_val: "60"
             value: "60 min"
             icon: "mdi:window-open"
-          - dps_val: 90
+          - dps_val: "90"
             value: "90 min"
             icon: "mdi:window-open"

+ 18 - 18
custom_components/tuya_local/devices/fancyled_fpgahdmi2_light.yaml

@@ -69,41 +69,41 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 80000000000000000000000000000000
+          - dps_val: "80000000000000000000000000000000"
             value: Screen - Movie
-          - dps_val: 81000000000000000000000000000000
+          - dps_val: "81000000000000000000000000000000"
             value: Screen - Video
-          - dps_val: 82000000000000000000000000000000
+          - dps_val: "82000000000000000000000000000000"
             value: Screen - Game
-          - dps_val: 83000000000000000000000000000000
+          - dps_val: "83000000000000000000000000000000"
             value: Music - Spectrum
-          - dps_val: 84000000000000000000000000000000
+          - dps_val: "84000000000000000000000000000000"
             value: Music - Electronic
-          - dps_val: 85000000000000000000000000000000
+          - dps_val: "85000000000000000000000000000000"
             value: Music - Listen
-          - dps_val: 86000000000000000000000000000000
+          - dps_val: "86000000000000000000000000000000"
             value: Scene - Rainbow
-          - dps_val: 87000000000000000000000000000000
+          - dps_val: "87000000000000000000000000000000"
             value: Scene - Fire
-          - dps_val: 88000000000000000000000000000000
+          - dps_val: "88000000000000000000000000000000"
             value: Scene - Read
-          - dps_val: 89000000000000000000000000000000
+          - dps_val: "89000000000000000000000000000000"
             value: Scene - Firework
-          - dps_val: 90000000000000000000000000000000
+          - dps_val: "90000000000000000000000000000000"
             value: Color Scene - Star
-          - dps_val: 91000000000000000000000000000000
+          - dps_val: "91000000000000000000000000000000"
             value: Color Scene - Drip
-          - dps_val: 92000000000000000000000000000000
+          - dps_val: "92000000000000000000000000000000"
             value: Color Scene - Particle
-          - dps_val: 93000000000000000000000000000000
+          - dps_val: "93000000000000000000000000000000"
             value: Color Scene - Flow
-          - dps_val: 94000000000000000000000000000000
+          - dps_val: "94000000000000000000000000000000"
             value: Color Scene - Ball
-          - dps_val: 95000000000000000000000000000000
+          - dps_val: "95000000000000000000000000000000"
             value: Color Scene - Swing
-          - dps_val: 96000000000000000000000000000000
+          - dps_val: "96000000000000000000000000000000"
             value: Color Scene - Breath
-          - dps_val: 97000000000000000000000000000000
+          - dps_val: "97000000000000000000000000000000"
             value: Color Scene - Pure
   - entity: select
     name: Installation side

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

@@ -28,11 +28,11 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: auto
-          - dps_val: 1
+          - dps_val: "1"
             value: "on"
-          - dps_val: 2
+          - dps_val: "2"
             value: "off"
   - entity: switch
     translation_key: motion_detection

+ 5 - 5
custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml

@@ -551,15 +551,15 @@ entities:
         name: option
         type: string
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: 1 kWh
-          - dps_val: 2
+          - dps_val: "2"
             value: 2 kWh
-          - dps_val: 3
+          - dps_val: "3"
             value: 3 kWh
-          - dps_val: 4
+          - dps_val: "4"
             value: 4 kWh
-          - dps_val: 5
+          - dps_val: "5"
             value: 5 kWh
         optional: true
       - id: 115

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

@@ -329,7 +329,7 @@ entities:
             step: 100
             value_redirect: mode6_val
       - id: 115
-        type: string
+        type: integer
         name: mode4_val
         range:
           min: 0

+ 10 - 10
custom_components/tuya_local/devices/gratkit_filament_dryer.yaml

@@ -164,25 +164,25 @@ entities:
         name: sensor
         type: string
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: "Normal"
-          - dps_val: 1
+          - dps_val: "1"
             value: "Dryer box tilted"
-          - dps_val: 2
+          - dps_val: "2"
             value: "Heat plate overheated"
-          - dps_val: 3
+          - dps_val: "3"
             value: "Dryer box overheated"
-          - dps_val: 4
+          - dps_val: "4"
             value: "Fan RPM too low"
-          - dps_val: 5
+          - dps_val: "5"
             value: "5"
-          - dps_val: 6
+          - dps_val: "6"
             value: "6"
-          - dps_val: 7
+          - dps_val: "7"
             value: "7"
-          - dps_val: 8
+          - dps_val: "8"
             value: "8"
-          - dps_val: 9
+          - dps_val: "9"
             value: "9"
   - entity: sensor
     name: Fan speed

+ 18 - 18
custom_components/tuya_local/devices/hdmi_sync_light.yaml

@@ -60,41 +60,41 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 80000000000000000000000000000000
+          - dps_val: "80000000000000000000000000000000"
             value: Screen - Movie
-          - dps_val: 81000000000000000000000000000000
+          - dps_val: "81000000000000000000000000000000"
             value: Screen - Video
-          - dps_val: 82000000000000000000000000000000
+          - dps_val: "82000000000000000000000000000000"
             value: Screen - Game
-          - dps_val: 83000000000000000000000000000000
+          - dps_val: "83000000000000000000000000000000"
             value: Music - Spectrum
-          - dps_val: 84000000000000000000000000000000
+          - dps_val: "84000000000000000000000000000000"
             value: Music - Electronic
-          - dps_val: 85000000000000000000000000000000
+          - dps_val: "85000000000000000000000000000000"
             value: Music - Listen
-          - dps_val: 86000000000000000000000000000000
+          - dps_val: "86000000000000000000000000000000"
             value: Scene - Rainbow
-          - dps_val: 87000000000000000000000000000000
+          - dps_val: "87000000000000000000000000000000"
             value: Scene - Fire
-          - dps_val: 88000000000000000000000000000000
+          - dps_val: "88000000000000000000000000000000"
             value: Scene - Read
-          - dps_val: 89000000000000000000000000000000
+          - dps_val: "89000000000000000000000000000000"
             value: Scene - Firework
-          - dps_val: 90000000000000000000000000000000
+          - dps_val: "90000000000000000000000000000000"
             value: Color Scene - Star
-          - dps_val: 91000000000000000000000000000000
+          - dps_val: "91000000000000000000000000000000"
             value: Color Scene - Drip
-          - dps_val: 92000000000000000000000000000000
+          - dps_val: "92000000000000000000000000000000"
             value: Color Scene - Particle
-          - dps_val: 93000000000000000000000000000000
+          - dps_val: "93000000000000000000000000000000"
             value: Color Scene - Flow
-          - dps_val: 94000000000000000000000000000000
+          - dps_val: "94000000000000000000000000000000"
             value: Color Scene - Ball
-          - dps_val: 95000000000000000000000000000000
+          - dps_val: "95000000000000000000000000000000"
             value: Color Scene - Swing
-          - dps_val: 96000000000000000000000000000000
+          - dps_val: "96000000000000000000000000000000"
             value: Color Scene - Breath
-          - dps_val: 97000000000000000000000000000000
+          - dps_val: "97000000000000000000000000000000"
             value: Color Scene - Pure
   - entity: time
     translation_key: timer

+ 8 - 8
custom_components/tuya_local/devices/holman_wx1_taptimer.yaml

@@ -243,13 +243,13 @@ entities:
         type: string
         optional: true
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: cancel
-          - dps_val: 24
+          - dps_val: "24"
             value: 24h
-          - dps_val: 48
+          - dps_val: "48"
             value: 48h
-          - dps_val: 72
+          - dps_val: "72"
             value: 72h
   - entity: select
     translation_key: time_format
@@ -260,9 +260,9 @@ entities:
         type: string
         optional: true
         mapping:
-          - dps_val: 12
+          - dps_val: "12"
             value: 12_hour
-          - dps_val: 24
+          - dps_val: "24"
             value: 24_hour
   - entity: binary_sensor
     name: Soil sensor power OK
@@ -289,9 +289,9 @@ entities:
         type: string
         optional: true
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: "l/C"
-          - dps_val: 2
+          - dps_val: "2"
             value: "gal/F"
   - entity: sensor
     name: Alarm status

+ 15 - 15
custom_components/tuya_local/devices/holman_wx2_taptimer.yaml

@@ -222,13 +222,13 @@ entities:
         name: option
         type: string
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: cancel
-          - dps_val: 24
+          - dps_val: "24"
             value: 24h
-          - dps_val: 48
+          - dps_val: "48"
             value: 48h
-          - dps_val: 72
+          - dps_val: "72"
             value: 72h
   - entity: select
     translation_key: time_format
@@ -239,12 +239,12 @@ entities:
         type: string
         optional: true
         mapping:
-          - dps_val: 12
+          - dps_val: "12"
             value: 12_hour
-          - dps_val: 24
+          - dps_val: "24"
             value: 24_hour
   - entity: binary_sensor
-    name: T&H soil sensor present 1
+    name: "T&H soil sensor present 1"
     category: diagnostic
     dps:
       - id: 115
@@ -259,7 +259,7 @@ entities:
         name: sensor
         type: string
   - entity: binary_sensor
-    name: T&H soil sensor power OK 1
+    name: "T&H soil sensor power OK 1"
     category: diagnostic
     dps:
       - id: 117
@@ -274,9 +274,9 @@ entities:
         optional: true
         type: string
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: "l/C"
-          - dps_val: 2
+          - dps_val: "2"
             value: "gal/F"
   - entity: sensor
     name: Alarm status
@@ -635,16 +635,16 @@ entities:
         name: option
         type: string
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: cancel
-          - dps_val: 24
+          - dps_val: "24"
             value: 24h
-          - dps_val: 48
+          - dps_val: "48"
             value: 48h
-          - dps_val: 72
+          - dps_val: "72"
             value: 72h
   - entity: binary_sensor
-    name: T&H soil sensor present 2
+    name: "T&H soil sensor present 2"
     category: diagnostic
     dps:
       - id: 161

+ 5 - 5
custom_components/tuya_local/devices/honeywell_air_touch_p2.yaml

@@ -24,15 +24,15 @@ entities:
         type: string
         name: speed
         mapping:
-          - dps_val: 'S'
+          - dps_val: "S"
             value: 20
-          - dps_val: 1
+          - dps_val: "1"
             value: 40
-          - dps_val: 2
+          - dps_val: "2"
             value: 60
-          - dps_val: 3
+          - dps_val: "3"
             value: 80
-          - dps_val: 4
+          - dps_val: "4"
             value: 100
 
   - entity: sensor

+ 25 - 21
custom_components/tuya_local/devices/kcvents_vt501_fan.yaml

@@ -16,14 +16,16 @@ entities:
         mapping:
           - dps_val: true
             value: 33
-          - dps_val: dummy_speed1
-            value: 66
-            value_redirect: speed2
-          - dps_val: dummy_speed2
-            value: 100
-            value_redirect: speed3
           - dps_val: false
             value_redirect: speed2
+            # dummy conditions to make all options visible to HA
+            conditions:
+              - dps_val: true
+                value: 66
+                value_redirect: speed2
+              - dps_val: true
+                value: 100
+                value_redirect: speed3
       - id: 102
         type: boolean
         name: speed2
@@ -48,23 +50,25 @@ entities:
         mapping:
           - dps_val: true
             value: "Low Humidity"
-          - dps_val: dummy_mode1
-            value: "Medium Humidity"
-            value_redirect: preset_mode1
-          - dps_val: dummy_mode2
-            value: "High Humidity"
-            value_redirect: preset_mode2
-          - dps_val: dummy_mode3
-            value: fresh
-            value_redirect: preset_mode3
-          - dps_val: dummy_mode4
-            value: anti_condensation
-            value_redirect: preset_mode4
-          - dps_val: dummy_mode5
-            value: circulate
-            value_redirect: preset_mode5
           - dps_val: false
             value_redirect: preset_mode1
+            # Dummy conditions to make redirected options visible to HA
+            conditions:
+              - dps_val: true
+                value: "Medium Humidity"
+                value_redirect: preset_mode1
+              - dps_val: true
+                value: "High Humidity"
+                value_redirect: preset_mode2
+              - dps_val: true
+                value: fresh
+                value_redirect: preset_mode3
+              - dps_val: true
+                value: anti_condensation
+                value_redirect: preset_mode4
+              - dps_val: true
+                value: circulate
+                value_redirect: preset_mode5
       - id: 106
         type: boolean
         name: preset_mode1

+ 8 - 8
custom_components/tuya_local/devices/klarta_forste4_purifier.yaml

@@ -26,21 +26,21 @@ entities:
         type: string
         name: speed
         mapping:
-          - dps_val: 8
+          - dps_val: "8"
             value: 100
-          - dps_val: 7
+          - dps_val: "7"
             value: 88
-          - dps_val: 6
+          - dps_val: "6"
             value: 75
-          - dps_val: 5
+          - dps_val: "5"
             value: 63
-          - dps_val: 4
+          - dps_val: "4"
             value: 50
-          - dps_val: 3
+          - dps_val: "3"
             value: 38
-          - dps_val: 2
+          - dps_val: "2"
             value: 25
-          - dps_val: 1
+          - dps_val: "1"
             value: 13
   - entity: sensor
     class: pm25

+ 8 - 8
custom_components/tuya_local/devices/kogan_air_purifier.yaml

@@ -15,11 +15,11 @@ entities:
         type: string
         name: preset_mode
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: sleep
-          - dps_val: 2
+          - dps_val: "2"
             value: strong
-          - dps_val: 3
+          - dps_val: "3"
             value: auto
   - entity: sensor
     translation_key: filter_life
@@ -37,9 +37,9 @@ entities:
         mapping:
           - dps_val: cancle
             value: 0
-          - dps_val: 1
+          - dps_val: "1"
             value: 128
-          - dps_val: 2
+          - dps_val: "2"
             value: 255
   - entity: button
     translation_key: filter_reset
@@ -56,11 +56,11 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: cancel
-          - dps_val: 2
+          - dps_val: "2"
             value: "4h"
-          - dps_val: 3
+          - dps_val: "3"
             value: "8h"
   - entity: sensor
     translation_key: time_remaining

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

@@ -39,11 +39,11 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: "off"
-          - dps_val: 1
+          - dps_val: "1"
             value: "on"
-          - dps_val: 2
+          - dps_val: "2"
             value: memory
   - entity: select
     translation_key: light_mode

+ 0 - 52
custom_components/tuya_local/devices/madimack_inverflow_pro.yaml

@@ -247,58 +247,6 @@ entities:
       - id: 2
         type: bitfield
         name: fault_code
-      - id: 2
-        type: bitfield
-        name: description
-        mapping:
-          - dps_val: 0
-            value: ok
-          - dps_val: "E001"
-            value: "E001 - Abnormal input voltage"
-          - dps_val: "E002"
-            value: "E002 - Output over current"
-          - dps_val: "E101"
-            value: "E101 - Heat sink over heat"
-          - dps_val: "E102"
-            value: "E102 - Heat sink sensor error"
-          - dps_val: "E103"
-            value: "E103 - Master driver board error"
-          - dps_val: "E104"
-            value: "E104 - Phase-deficient protection"
-          - dps_val: "E105"
-            value: "E105 - AC current sampling circuit failure"
-          - dps_val: "E106"
-            value: "E106 - DC abnormal voltage"
-          - dps_val: "E107"
-            value: "E107 - PFC protection"
-          - dps_val: "E108"
-            value: "E108 - Motor power overload"
-          - dps_val: "E201"
-            value: "E201 - Circuit board error"
-          - dps_val: "E202"
-            value: "E202 - Master board EEPROM reading failure"
-          - dps_val: "E203"
-            value: "E203 - RTC time reading error"
-          - dps_val: "E204"
-            value: "E204 - Display Board EEPROM reading failure"
-          - dps_val: "E205"
-            value: "E205 - Communication Error"
-          - dps_val: "E206"
-            value: "E206 - RS485 communication Error"
-          - dps_val: "E207"
-            value: "E207 - No water protection"
-          - dps_val: "E208"
-            value: "E208 - Pressure sensor failure"
-          - dps_val: "E209"
-            value: "E209 - Loss of prime"
-          - dps_val: "AL01"
-            value: "AL01 - High temperature warning deceleration"
-          - dps_val: "AL02"
-            value: "AL02 - AC voltage low droop"
-          - dps_val: "AL03"
-            value: "AL03 - Anti Freezing"
-          - dps_val: "E003"
-            value: "E003 - No water protection"
   - entity: binary_sensor
     name: Flow pressure warning
     category: diagnostic

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

@@ -73,9 +73,9 @@ entities:
         name: option
         optional: true
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: "on"
-          - dps_val: 1
+          - dps_val: "1"
             value: "off"
-          - dps_val: 2
+          - dps_val: "2"
             value: memory

+ 10 - 10
custom_components/tuya_local/devices/nac_ap470_purifier.yaml

@@ -14,17 +14,17 @@ entities:
         type: string
         name: preset_mode
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: auto
-          - dps_val: 2
+          - dps_val: "2"
             value: sleep
-          - dps_val: 3
+          - dps_val: "3"
             value: low
-          - dps_val: 4
+          - dps_val: "4"
             value: medium
-          - dps_val: 4
+          - dps_val: "5"
             value: high
-          - dps_val: 6
+          - dps_val: "6"
             value: strong
   - entity: sensor
     class: pm25
@@ -108,13 +108,13 @@ entities:
         mapping:
           - dps_val: cancle
             value: cancel
-          - dps_val: 2
+          - dps_val: "2"
             value: "2h"
-          - dps_val: 4
+          - dps_val: "4"
             value: "4h"
-          - dps_val: 6
+          - dps_val: "6"
             value: "6h"
-          - dps_val: 8
+          - dps_val: "8"
             value: "8h"
   - entity: sensor
     translation_key: time_remaining

+ 4 - 4
custom_components/tuya_local/devices/neatsvor_x600_vacuum.yaml

@@ -282,16 +282,16 @@ entities:
         name: option
         type: string
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Never
             icon: "mdi:numeric-0"
-          - dps_val: 1
+          - dps_val: "1"
             value: After each clean
             icon: "mdi:numeric-1"
-          - dps_val: 2
+          - dps_val: "2"
             value: After 2 cleans
             icon: "mdi:numeric-2"
-          - dps_val: 3
+          - dps_val: "3"
             value: After 3 cleans
             icon: "mdi:numeric-3"
   - entity: button

+ 2 - 5
custom_components/tuya_local/devices/nedis_outdoor_camera.yaml

@@ -209,13 +209,10 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Low
-          - dps_val: 1
+          - dps_val: "1"
             value: High
-          - dps_val: null
-            value: Unknown
-            hidden: true
   - entity: select
     translation_key: recording_mode
     category: config

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

@@ -42,7 +42,7 @@ entities:
     category: config
     dps:
       - id: 8
-        type: integer
+        type: string
         optional: true
         name: volume_level
         mapping:

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

@@ -35,9 +35,9 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 1
+          - dps_val: "1"
             value: "on"
-          - dps_val: 0
+          - dps_val: "0"
             value: "off"
-          - dps_val: 2
+          - dps_val: "2"
             value: memory

+ 4 - 4
custom_components/tuya_local/devices/powerworld_pw040_waterheatpump.yaml

@@ -151,9 +151,9 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Manual
-          - dps_val: 1
+          - dps_val: "1"
             value: Eco
   - entity: sensor
     translation_key: outlet_temperature
@@ -421,9 +421,9 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Immediate stop
-          - dps_val: 1
+          - dps_val: "1"
             value: Ramp down
   - entity: number  # defrost start temperature
     name: Defrost start temperature

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

@@ -218,7 +218,7 @@ entities:
     name: Forced
     dps:
       - id: 105
-        type: string
+        type: boolean
         name: event
         optional: true
         mapping:

+ 4 - 4
custom_components/tuya_local/devices/t5e_wf_thermostat.yaml

@@ -334,10 +334,10 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 5_2
-            value: 5 + 2
-          - dps_val: 6_1
-            value: 6 + 1
+          - dps_val: "5_2"
+            value: "5 + 2"
+          - dps_val: "6_1"
+            value: "6 + 1"
   - entity: button
     translation_key: factory_reset
     category: config

+ 5 - 5
custom_components/tuya_local/devices/termoplaza_panel_heater.yaml

@@ -121,15 +121,15 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Low
-          - dps_val: 1
+          - dps_val: "1"
             value: Average
-          - dps_val: 2
+          - dps_val: "2"
             value: Above avg
-          - dps_val: 3
+          - dps_val: "3"
             value: Comfort
-          - dps_val: 4
+          - dps_val: "4"
             value: High
   - name: Maximum surface temperature
     entity: number

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

@@ -35,7 +35,7 @@ entities:
     class: battery
     dps:
       - id: 3
-        type: integer
+        type: string
         name: sensor
         unit: "%"
         mapping:

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

@@ -82,37 +82,37 @@ entities:
         name: option
         optional: true
         mapping:
-          - dps_val: 119
+          - dps_val: "119"
             value: "Classic 25%"
-          - dps_val: 132
+          - dps_val: "132"
             value: "Classic 50%"
-          - dps_val: 14b
+          - dps_val: "14b"
             value: "Classic 75%"
-          - dps_val: 164
+          - dps_val: "164"
             value: "Classic 100%"
-          - dps_val: 219
+          - dps_val: "219"
             value: "Soft 25%"
-          - dps_val: 232
+          - dps_val: "232"
             value: "Soft 50%"
-          - dps_val: 24b
+          - dps_val: "24b"
             value: "Soft 75%"
-          - dps_val: 264
+          - dps_val: "264"
             value: "Soft 100%"
-          - dps_val: 319
+          - dps_val: "319"
             value: "Dynamic 25%"
-          - dps_val: 332
+          - dps_val: "332"
             value: "Dynamic 50%"
-          - dps_val: 34b
+          - dps_val: "34b"
             value: "Dynamic 75%"
-          - dps_val: 364
+          - dps_val: "364"
             value: "Dynamic 100%"
-          - dps_val: 419
+          - dps_val: "419"
             value: "Disco 25%"
-          - dps_val: 432
+          - dps_val: "432"
             value: "Disco 50%"
-          - dps_val: 44b
+          - dps_val: "44b"
             value: "Disco 75%"
-          - dps_val: 464
+          - dps_val: "464"
             value: "Disco 100%"
   - entity: select
     translation_key: mode

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

@@ -14,7 +14,7 @@ entities:
     dps:
       - id: 4
         name: hvac_mode
-        type: boolean
+        type: string
         mapping:
           - value: cool
             dps_val: "0"

+ 4 - 4
custom_components/tuya_local/devices/vestfrost_vp_a1z40hw_purifier.yaml

@@ -115,11 +115,11 @@ entities:
         type: string
         name: option
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: PM2.5
-          - dps_val: 1
+          - dps_val: "1"
             value: PM1
-          - dps_val: 2
+          - dps_val: "2"
             value: PM10
-          - dps_val: 3
+          - dps_val: "3"
             value: TVOC

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

@@ -158,7 +158,7 @@ entities:
     icon: "mdi:skip-next"
     dps:
       - id: 67
-        type: boolean
+        type: string
         optional: true
         name: button
         mapping:

+ 5 - 4
custom_components/tuya_local/devices/tuya_000004rime_weather_station.yaml → custom_components/tuya_local/devices/weatherstationpro_weatherstation.yaml

@@ -1,4 +1,5 @@
 name: Weather station
+legacy_type: tuya_000004rime_weather_station
 products:
   - id: nghjvn2pcjllwska
     model: WeatherStation Pro™
@@ -153,13 +154,13 @@ entities:
         type: string
         name: alarm_state
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Alarm
-          - dps_val: 1
+          - dps_val: "1"
             value: Silent
-          - dps_val: 2
+          - dps_val: "2"
             value: Enabled
-          - dps_val: 3
+          - dps_val: "3"
             value: Disabled
       - id: 109
         optional: true

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

@@ -124,7 +124,7 @@ entities:
     name: Realtime updates
     dps:
       - id: 35
-        type: boolean
+        type: string
         optional: true
         name: button
         mapping:

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

@@ -25,7 +25,7 @@ entities:
     class: battery
     dps:
       - id: 3
-        type: integer
+        type: string
         name: sensor
         optional: true
         unit: "%"