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

Refactor sensor error handling to align with binary_sensor pattern using 'problem' class

Kevin Ou 1 год назад
Родитель
Сommit
0eb9b0424b
1 измененных файлов с 17 добавлено и 11 удалено
  1. 17 11
      custom_components/tuya_local/devices/drexma_et7aw_thermostat.yaml

+ 17 - 11
custom_components/tuya_local/devices/drexma_et7aw_thermostat.yaml

@@ -80,26 +80,32 @@ entities:
             value: heating
             value: heating
           - dps_val: false
           - dps_val: false
             value: idle
             value: idle
-  - entity: select
-    class: sensor
-    type: string
-    readonly: true
+  - entity: binary_sensor
+    class: problem
     category: diagnostic
     category: diagnostic
-    name: Sensor Error
-    icon: "mdi:thermometer-alert"
     dps:
     dps:
       - id: 104
       - id: 104
         type: bitfield
         type: bitfield
-        name: option
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 104
+        type: bitfield
+        name: fault_code
+      - id: 104
+        type: bitfield
+        name: description
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
-            value: None
+            value: ok
           - dps_val: 1
           - dps_val: 1
-            value: Room
+            value: Room sensor fault
           - dps_val: 2
           - dps_val: 2
-            value: Floor
+            value: Floor sensor fault
           - dps_val: 4
           - dps_val: 4
-            value: GFCI
+            value: GFCI fault
   - entity: sensor
   - entity: sensor
     name: Room temperature
     name: Room temperature
     class: temperature
     class: temperature