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

MRC Magnum: add default mapping for temperature hysteresis

At startup, HA checks the mapping exists, even before getting data from
the device. If it does not exist yet, the entity ends up disabled, even
after the data comes and selects which options should be presented.

Issue #3008
Jason Rumney 1 год назад
Родитель
Сommit
ea6671c981
1 измененных файлов с 16 добавлено и 5 удалено
  1. 16 5
      custom_components/tuya_local/devices/mrc_magnum_floorheater.yaml

+ 16 - 5
custom_components/tuya_local/devices/mrc_magnum_floorheater.yaml

@@ -42,7 +42,6 @@ entities:
       - id: 16
         type: integer
         name: temperature
-        unit: C
         range:
           min: 50
           max: 400
@@ -249,12 +248,13 @@ entities:
       - id: 112
         type: integer
         name: value
+        unit: °
         range:
           min: -90
           max: 90
         mapping:
           - scale: 10
-            constraint: unit
+            constraint: temp_unit
             conditions:
               - dps_val: false
                 range:
@@ -262,7 +262,7 @@ entities:
                   max: 50
       - id: 107
         type: boolean
-        name: unit
+        name: temp_unit
         hidden: true
   - entity: number
     name: Floor temperature calibration
@@ -273,12 +273,13 @@ entities:
         type: integer
         name: value
         optional: true
+        unit: °
         range:
           min: -90
           max: 90
         mapping:
           - scale: 10
-            constraint: unit
+            constraint: temp_unit
             conditions:
               - dps_val: false
                 range:
@@ -286,7 +287,7 @@ entities:
                   max: 50
       - id: 107
         type: boolean
-        name: unit
+        name: temp_unit
         hidden: true
   - entity: select
     name: Temperature hysteresis
@@ -319,6 +320,16 @@ entities:
                     value: "3.0"
                   - dps_val: "3"
                     value: "4.0"
+              - dps_val: null
+                mapping:
+                  - dps_val: "0_5"
+                    value: "0.5"
+                  - dps_val: "1"
+                    value: "1.0"
+                  - dps_val: "2"
+                    value: "1.5"
+                  - dps_val: "3"
+                    value: "2.0"
       - id: 107
         type: boolean
         name: unit