瀏覽代碼

feat(holman_wx1_taptimer): merge in garza_irrigation_system

Garza irrigation system seems to be a subset of the Holman WX1. It may
just be that only partial data was received.

With more use of optional, and marking entities as hidden if
unavailable, the Garza can be merged in to reduce maintenance.

Issue #3542
Jason Rumney 11 月之前
父節點
當前提交
4c9a67871f

+ 0 - 83
custom_components/tuya_local/devices/garza_irrigation_system.yaml

@@ -1,83 +0,0 @@
-name: Garden irrigation system
-products:
-  - id: xnajzurgqo1ugohn
-    manufacturer: Garza
-    model: ITV103W
-entities:
-  - entity: valve
-    class: water
-    dps:
-      - id: 108
-        type: boolean
-        name: valve
-        mapping:
-          - dps_val: true
-            value: false
-          - dps_val: false
-            value: true
-  - entity: sensor
-    class: battery
-    category: diagnostic
-    dps:
-      - id: 105
-        type: integer
-        name: sensor
-        unit: "%"
-        mapping:
-          - dps_val: 0
-            value: 10
-          - dps_val: 1
-            value: 50
-          - dps_val: 2
-            value: 100
-  - entity: sensor
-    name: Water flow
-    class: water
-    category: diagnostic
-    icon: "mdi:water"
-    dps:
-      - id: 103
-        name: sensor
-        type: integer
-        unit: L
-  - entity: number
-    translation_key: timer
-    class: duration
-    category: config
-    dps:
-      - id: 107
-        type: integer
-        name: value
-        unit: min
-        range:
-          min: 0
-          max: 60
-  - entity: sensor
-    translation_key: status
-    class: enum
-    category: diagnostic
-    dps:
-      - id: 106
-        type: integer
-        name: sensor
-        mapping:
-          - dps_val: 0
-            value: idle
-          - dps_val: 1
-            value: manual
-          - dps_val: 2
-            value: auto
-  - entity: binary_sensor
-    category: diagnostic
-    class: problem
-    dps:
-      - id: 120
-        type: bitfield
-        name: sensor
-        mapping:
-          - dps_val: 0
-            value: false
-          - value: true
-      - id: 120
-        type: bitfield
-        name: fault_code

+ 41 - 2
custom_components/tuya_local/devices/holman_wx1_taptimer.yaml

@@ -1,4 +1,5 @@
 name: Tap timer
 name: Tap timer
+legacy_type: garza_irrigation_system
 products:
 products:
   - id: zrsgzc8jktsricjj
   - id: zrsgzc8jktsricjj
     manufacturer: Holman
     manufacturer: Holman
@@ -7,6 +8,9 @@ products:
   - id: ixckfr3zke5fgach
   - id: ixckfr3zke5fgach
     manufacturer: RainPoint
     manufacturer: RainPoint
     model: TCS005FRF
     model: TCS005FRF
+  - id: xnajzurgqo1ugohn
+    manufacturer: Garza
+    model: ITV103W
 entities:
 entities:
   - entity: valve
   - entity: valve
     name: Manual
     name: Manual
@@ -28,23 +32,43 @@ entities:
     name: Soil temperature
     name: Soil temperature
     class: temperature
     class: temperature
     category: diagnostic
     category: diagnostic
+    hidden: unavailable
     dps:
     dps:
       - id: 101
       - id: 101
         name: sensor
         name: sensor
         type: integer
         type: integer
+        optional: true
         unit: C
         unit: C
       - id: 115
       - id: 115
-        name: sensor_present
+        name: available
         type: boolean
         type: boolean
+        optional: true
+        mapping:
+          - dps_val: null
+            value: false
   - entity: sensor
   - entity: sensor
     name: Soil moisture
     name: Soil moisture
     class: moisture
     class: moisture
     category: diagnostic
     category: diagnostic
+    hidden: unavailable
     dps:
     dps:
       - id: 102
       - id: 102
         name: sensor
         name: sensor
         type: integer
         type: integer
+        optional: true
         unit: "%"
         unit: "%"
+      - id: 102
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - dps_val: 65535
+            value: false
+          - dps_val: -1
+            value: false
+          - value: true
   - entity: sensor
   - entity: sensor
     name: Water flow
     name: Water flow
     class: water
     class: water
@@ -219,6 +243,7 @@ entities:
       - id: 113
       - id: 113
         name: option
         name: option
         type: string
         type: string
+        optional: true
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
             value: cancel
             value: cancel
@@ -244,10 +269,19 @@ entities:
   - entity: binary_sensor
   - entity: binary_sensor
     name: Soil sensor power OK
     name: Soil sensor power OK
     category: diagnostic
     category: diagnostic
+    hidden: unavailable
     dps:
     dps:
       - id: 117
       - id: 117
         name: sensor
         name: sensor
+        optional: true
         type: boolean
         type: boolean
+      - id: 115
+        name: available
+        type: boolean
+        optional: true
+        mapping:
+          - dps_val: null
+            value: false
   - entity: select
   - entity: select
     name: Units
     name: Units
     category: config
     category: config
@@ -396,14 +430,19 @@ entities:
   - entity: binary_sensor
   - entity: binary_sensor
     name: Postponed due to rain
     name: Postponed due to rain
     category: diagnostic
     category: diagnostic
+    hidden: unavailable
     dps:
     dps:
       - id: 125
       - id: 125
         name: sensor
         name: sensor
         type: boolean
         type: boolean
+        optional: true
       - id: 116
       - id: 116
         optional: true
         optional: true
-        name: sensor_present
+        name: available
         type: boolean
         type: boolean
+        mapping:
+          - dps_val: null
+            value: false
   - entity: sensor
   - entity: sensor
     # based on starts A, B and C
     # based on starts A, B and C
     name: Next watering encoded
     name: Next watering encoded