Parcourir la source

Dr Heater DR008 Thermostat: changes from review

- split preset_mode out from unnatural mapping to hvac_mode inherited from JIahong thermostat.
- follow naming convention
- use translations where possible
- follow Jiahong for "energy" sensor. Apart from temperature range and a couple of missing dps, they are identical, so this is likely a run time sensor which combined with "calibration" (wattage) can be used to calculate energy as per Jiahong, rather than a direct energy reading.
Jason Rumney il y a 1 an
Parent
commit
256f8cb368

+ 20 - 22
custom_components/tuya_local/devices/dr_heater_dr008_thermostat.yaml

@@ -1,6 +1,10 @@
-name: Dr. Heater DR-008 Electric Radiant Floor Thermostat
+name: Floor thermostat
+# products:
+#   - id: UNKNOWN
+#     name: Dr. Heater DR-008
 primary_entity:
 primary_entity:
   entity: climate
   entity: climate
+  translation_key: thermostat
   dps:
   dps:
     - id: 101
     - id: 101
       type: boolean
       type: boolean
@@ -9,14 +13,7 @@ primary_entity:
         - dps_val: false
         - dps_val: false
           value: "off"
           value: "off"
         - dps_val: true
         - dps_val: true
-          constraint: mode
-          conditions:
-            - dps_val: "Smart"
-              value: auto
-            - dps_val: "Manual"
-              value: heat
-            - dps_val: "Anti_frozen"
-              value: cool
+          value: heat
     - id: 102
     - id: 102
       type: integer
       type: integer
       name: temperature
       name: temperature
@@ -35,8 +32,14 @@ primary_entity:
                 max: 1220
                 max: 1220
     - id: 103
     - id: 103
       type: string
       type: string
-      name: mode
-      hidden: true
+      name: preset_mode
+      mapping:
+        - dps_val: Smart
+          value: program
+        - dps_val: Manual
+          value: manual
+        - dps_val: Anti_frozen
+          value: away
     - id: 105
     - id: 105
       type: integer
       type: integer
       name: current_temperature
       name: current_temperature
@@ -89,17 +92,12 @@ primary_entity:
         max: 9
         max: 9
 secondary_entities:
 secondary_entities:
   - entity: lock
   - entity: lock
-    name: Screen lock
+    translation_key: child_lock
     category: config
     category: config
     dps:
     dps:
       - id: 108
       - id: 108
         type: boolean
         type: boolean
         name: lock
         name: lock
-        mapping:
-          - dps_val: true
-            icon: "mdi:hand-back-right-off"
-          - dps_val: false
-            icon: "mdi:hand-back-right"
   - entity: sensor
   - entity: sensor
     name: Room temperature
     name: Room temperature
     class: temperature
     class: temperature
@@ -139,17 +137,17 @@ secondary_entities:
           - dps_val: true
           - dps_val: true
             value: F
             value: F
   - entity: sensor
   - entity: sensor
-    name: Energy
+    name: Runtime
+    class: duration
+    category: diagnostic    
     dps:
     dps:
       - id: 117
       - id: 117
         type: integer
         type: integer
         name: sensor
         name: sensor
-        unit: kWh
-        mapping:
-          - scale: 10
+        unit: min
       - id: 116
       - id: 116
         type: integer
         type: integer
-        name: calibration
+        name: wattage
   - entity: select
   - entity: select
     category: config
     category: config
     translation_key: temperature_unit
     translation_key: temperature_unit