Bladeren bron

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