Prechádzať zdrojové kódy

T5E WF thermostat: convert broken fault sensor to binary_sensor

The fault codes are not informative so just putting them untranslated on
an attribute, with a single binary_sensor for fault seems more useful.
In any case, the dps naming was wrong so this sensor was not working.
Jason Rumney 3 rokov pred
rodič
commit
5eccab2937

+ 11 - 18
custom_components/tuya_local/devices/t5e_wf_thermostat.yaml

@@ -178,6 +178,12 @@ primary_entity:
           value: C
         - dps_val: f
           value: F
+    - id: 45
+      type: bitfield
+      name: fault_code
+      mapping:
+        - dps_val: 0
+          value: OK
     - id: 58
       type: string
       name: unknown_58
@@ -382,28 +388,15 @@ secondary_entities:
           max: 100
         mapping:
         - step: 10
-  - entity: sensor
+  - entity: binary_sensor
     name: Fault
     category: diagnostic
-    icon: "mdi:alert-circle"
+    class: problem
     dps:
       - id: 45
         type: bitfield
-        name: Fault
+        name: sensor
         mapping:
           - dps_val: 0
-            value: OK
-          - dps_val: 1
-            value: Error 1
-          - dps_val: 2
-            value: Error 2
-          - dps_val: 4
-            value: Error 3
-          - dps_val: 8
-            value: Error 4
-          - dps_val: 16
-            value: Error 5
-          - dps_val: 32
-            value: Error 6
-          - dps_val: 64
-            value: Error 7
+            value: false
+          - value: true