فهرست منبع

fix(krain_krx8_irrigation_controller): leave programs available, add sensors

- program settings were conditionally available based on whether programs
  are enabled or not, but device does not report whether they are enabled
  so default case needs to be enabled.

- add some of the decoded sensors from dp 134
  There are many more, but bitfields or complex multivalue encodes make
  them more work than is reasonable to expose.

Issue #6393
Jason Rumney 2 روز پیش
والد
کامیت
4ac56baea0
1فایلهای تغییر یافته به همراه63 افزوده شده و 0 حذف شده
  1. 63 0
      custom_components/tuya_local/devices/krain_krx8_irrigation_controller.yaml

+ 63 - 0
custom_components/tuya_local/devices/krain_krx8_irrigation_controller.yaml

@@ -142,6 +142,7 @@ entities:
     dps:
       - id: 121
         type: boolean
+        optional: true
         name: switch
   - entity: switch
     name: Program A
@@ -150,10 +151,15 @@ entities:
     dps:
       - id: 122
         type: boolean
+        optional: true
         name: switch
       - id: 121
         type: boolean
+        optional: true
         name: available
+        mapping:
+          - dps_val: null
+            value: true
   - entity: switch
     name: Program B
     icon: "mdi:timetable"
@@ -161,10 +167,15 @@ entities:
     dps:
       - id: 123
         type: boolean
+        optional: true
         name: switch
       - id: 121
         type: boolean
+        optional: true
         name: available
+        mapping:
+          - dps_val: null
+            value: true
   - entity: switch
     name: Program C
     icon: "mdi:timetable"
@@ -172,10 +183,15 @@ entities:
     dps:
       - id: 124
         type: boolean
+        optional: true
         name: switch
       - id: 121
         type: boolean
+        optional: true
         name: available
+        mapping:
+          - dps_val: null
+            value: true
   - entity: switch
     name: Program D
     icon: "mdi:timetable"
@@ -230,6 +246,7 @@ entities:
     dps:
       - id: 126
         type: integer
+        optional: true
         name: value
         unit: d
         range:
@@ -298,3 +315,49 @@ entities:
       - id: 134
         type: base64
         name: technical_info
+  - entity: sensor
+    name: Battery voltage
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 134
+        type: base64
+        mask: "FF00000000000000000000000000000000000000000000000000000000"
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    name: Supply voltage
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 134
+        type: base64
+        mask: "FF000000000000000000000000000000000000000000000000000000"
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    translation_key: time_remaining
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 134
+        type: base64
+        mask: "FF0000000000000000000000000000000000000000000000000000"
+        name: sensor
+        unit: min
+  - entity: sensor
+    class: signal_strength
+    category: diagnostic
+    dps:
+      - id: 134
+        type: base64
+        mask: "FF00000000000000000000000000000000000000"
+        name: sensor
+        unit: dBm
+        class: measurement