Explorar o código

fix(oscal_powermax2400pro_portablepower): fault tolerant handling of temperature units

Ensure there is always a default unit (C) in case the unit dp is missing,
or an unexpected value.
Jason Rumney hai 6 días
pai
achega
9033e57657

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

@@ -300,10 +300,9 @@ entities:
         type: string
         type: string
         name: unit
         name: unit
         mapping:
         mapping:
-          - dps_val: c
-            value: C
           - dps_val: f
           - dps_val: f
             value: F
             value: F
+          - value: C
   - entity: sensor
   - entity: sensor
     name: Pack 1 output
     name: Pack 1 output
     class: power
     class: power
@@ -337,10 +336,9 @@ entities:
         type: string
         type: string
         name: unit
         name: unit
         mapping:
         mapping:
-          - dps_val: c
-            value: C
           - dps_val: f
           - dps_val: f
             value: F
             value: F
+          - value: C
   - entity: sensor
   - entity: sensor
     name: Pack 2 output
     name: Pack 2 output
     class: power
     class: power
@@ -473,10 +471,9 @@ entities:
         type: string
         type: string
         name: unit
         name: unit
         mapping:
         mapping:
-          - dps_val: c
-            value: C
           - dps_val: f
           - dps_val: f
             value: F
             value: F
+          - value: C
   - entity: sensor
   - entity: sensor
     name: Pack 5 output
     name: Pack 5 output
     class: power
     class: power