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

fix(klarta_stor2_purifier): map air quality to translations

This serves two purposes:
- a fixed list of values makes automations easier to set up from the UI.
- translations are available if common values are used

Assumed set of values taken from dps info in Issue #2594 for Klarta Forte 4
Probably the manufacturer uses common mappings even if the overall dps are
different.

Related to PR #3546
Jason Rumney 7 месяцев назад
Родитель
Сommit
a6c10fb172
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      custom_components/tuya_local/devices/klarta_stor2_purifier.yaml

+ 10 - 0
custom_components/tuya_local/devices/klarta_stor2_purifier.yaml

@@ -127,7 +127,17 @@ entities:
         class: measurement
   - entity: sensor
     translation_key: air_quality
+    class: enum
     dps:
       - id: 21
         type: string
         name: sensor
+        mapping:
+          - dps_val: great
+            value: excellent
+          - dps_val: good
+            value: good
+          - dps_val: mild
+            value: moderate
+          - dps_val: poor
+            value: poor