瀏覽代碼

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 9 月之前
父節點
當前提交
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