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

feat(fral_supercool_airconditioner_fsc08): updates for merge

- remove duplication from products section
- remove redundant readonly, unit and range tags
- add redirection to Fahrenheit values when unit is F
- revert units to simpler ASCII versions that are remapped in code to HA constants

PR #3360
Jason Rumney 7 месяцев назад
Родитель
Сommit
7066a8665b

+ 34 - 17
custom_components/tuya_local/devices/fral_supercool_airconditioner_fsc08.yaml

@@ -3,7 +3,6 @@ products:
   - id: pkudk18s3u1dshxn
     manufacturer: Fral
     model: Super Cool FSC08 WiFi
-    model_id: FSC08
 entities:
   - entity: climate
     dps:
@@ -26,19 +25,30 @@ entities:
         type: integer
         name: temperature
         optional: true
-        unit: °C
         range:
           min: 17
-          max: 30
+          max: 86
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: c
+                range:
+                  min: 17
+                  max: 30
+              - dps_val: f
+                value_redirect: temp_set_f
+                range:
+                  min: 63
+                  max: 86
       - id: 3
         type: integer
         name: current_temperature
-        readonly: true
         optional: true
-        unit: °C
-        range:
-          min: 0
-          max: 50
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: f
+                value_redirect: temp_current_f
       - id: 4
         type: string
         name: mode
@@ -58,23 +68,17 @@ entities:
         name: temperature_unit
         mapping:
           - dps_val: c
-            value: °C
+            value: C
           - dps_val: f
-            value: °F
+            value: F
       - id: 23
         type: integer
         name: temp_current_f
-        readonly: true
         optional: true
-        unit: °F
-        range:
-          min: 32
-          max: 99
       - id: 24
         type: integer
         name: temp_set_f
         optional: true
-        unit: °F
         range:
           min: 63
           max: 86
@@ -86,8 +90,21 @@ entities:
             value: "on"
           - dps_val: false
             value: "off"
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 19
+        type: string
+        name: temperature_unit
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit
   - entity: select
     translation_key: timer
+    category: config
     dps:
       - id: 20
         type: string
@@ -146,9 +163,9 @@ entities:
   - entity: sensor
     class: duration
     translation_key: time_remaining
+    category: diagnostic
     dps:
       - id: 21
         type: integer
         name: sensor
-        readonly: true
         unit: min