Преглед изворни кода

Add support for Mi-Heat TH11-WF thermostat (#3793)

* Add support for Mi-Heat TH11-WF thermostat

* Add config for new device
* Add translation_keys for "holiday_mode" and "eco_mode"
* Add default icons for said translation_keys

* Fixed lint and type errors

* cleanup (miheat_th11wf_thermostat): changes from review

- rename file without hyphens to follow brand_model_type convention.
- comment products section with invalid id
- remove redundant `persist: true` directives
- fix step config for temperature
- combine mode and holiday_mode into climate preset_mode
- rename eco_mode to Eco, which is the same in most languages
- revert translations for holiday_mode and eco_mode
- convert status sensor with only value as "ok" to a problem binary_sensor
- convert window sensor to a binary_sensor, guessing the string values
- add icon for Boost, and use standard translations for times

PR #3783

* Fix typo in measurement class for thermostat

---------

Co-authored-by: Jason Rumney <jasonrumney@gmail.com>
Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
flow-c пре 3 месеци
родитељ
комит
f21e95bb4a

+ 191 - 0
custom_components/tuya_local/devices/miheat_th11wf_thermostat.yaml

@@ -0,0 +1,191 @@
+name: Thermostat
+# products:
+#   - id: UNKNOWN
+#     manufacturer: Mi-Heat
+#     model: TH11-WF
+entities:
+  - entity: climate
+    translation_key: thermostat
+    dps:
+      - id: 1
+        name: hvac_mode
+        type: boolean
+        mapping:
+          - dps_val: false
+            value: "off"
+            hidden: true
+          - dps_val: true
+            constraint: mode
+            conditions:
+              - dps_val: cool
+                value: cool
+              - dps_val: heat
+                value: heat
+      - id: 2
+        name: temperature
+        type: integer
+        range:
+          min: 50
+          max: 350
+        unit: C
+        mapping:
+          - scale: 10
+            step: 5
+      - id: 3
+        name: current_temperature
+        type: integer
+        mapping:
+          - scale: 10
+      - id: 4
+        name: mode
+        type: string
+        hidden: true
+      - id: 113
+        type: boolean
+        name: preset_mode
+        mapping:
+          - dps_val: true
+            value: away
+          - dps_val: false
+            constraint: p_mode
+            conditions:
+              - dps_val: manual
+                value: manual
+              - dps_val: program
+                value: program
+      - id: 111
+        type: string
+        name: p_mode
+        hidden: true
+  - entity: sensor
+    class: humidity
+    dps:
+      - id: 121
+        name: sensor
+        type: integer
+        unit: "%"
+        class: measurement
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 9
+        name: lock
+        type: boolean
+  - entity: sensor
+    class: power
+    dps:
+      - id: 10
+        name: sensor
+        type: integer
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 11
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 11
+        type: bitfield
+        name: fault_code
+  - entity: sensor
+    class: energy
+    dps:
+      - id: 110
+        name: sensor
+        type: integer
+        precision: 0
+        unit: kWh
+        class: total_increasing
+  - entity: binary_sensor
+    class: window
+    dps:
+      - id: 112
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: open
+            value: true
+          - value: false
+  - entity: switch
+    name: Eco
+    icon: "mdi:leaf"
+    category: config
+    dps:
+      - id: 8
+        type: boolean
+        name: switch
+  - entity: switch
+    translation_key: anti_frost
+    category: config
+    dps:
+      - id: 123
+        type: boolean
+        name: switch
+  - entity: select
+    name: Boost
+    translation_key: timer
+    icon: "mdi:rocket-launch"
+    dps:
+      - id: 120
+        type: string
+        name: option
+        mapping:
+          - dps_val: cancel
+            value: cancel
+          - dps_val: "5min"
+            value: "5m"
+          - dps_val: "10min"
+            value: "10m"
+          - dps_val: "15min"
+            value: "15m"
+          - dps_val: "20min"
+            value: "20m"
+          - dps_val: "25min"
+            value: "25m"
+          - dps_val: "30min"
+            value: "30m"
+          - dps_val: "35min"
+            value: "35m"
+          - dps_val: "40min"
+            value: "40m"
+          - dps_val: "45min"
+            value: "45m"
+          - dps_val: "50min"
+            value: "50m"
+          - dps_val: "55min"
+            value: "55m"
+          - dps_val: "60min"
+            value: "1h"
+          - dps_val: "65min"
+            value: "1h5m"
+          - dps_val: "70min"
+            value: "1h10m"
+          - dps_val: "75min"
+            value: "1h15m"
+          - dps_val: "80min"
+            value: "1h20m"
+          - dps_val: "85min"
+            value: "1h25m"
+          - dps_val: "90min"
+            value: "1h30m"
+          - dps_val: "95min"
+            value: "1h35m"
+          - dps_val: "100min"
+            value: "1h40m"
+          - dps_val: "105min"
+            value: "1h45m"
+          - dps_val: "110min"
+            value: "1h50m"
+          - dps_val: "115min"
+            value: "1h55m"
+          - dps_val: "120min"
+            value: "2h"

+ 1 - 1
custom_components/tuya_local/translations/de.json

@@ -825,7 +825,7 @@
         },
         "switch": {
             "anti_frost": {
-                "name": "Anti-Frost"
+                "name": "Anti-frost"
             },
             "breaker": {
                 "name": "Leistungsschalter",