From e803d51705d55cac53fd8b58c551d2f278549ebb Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sat, 9 Mar 2024 01:15:48 +0900 Subject: [PATCH] Additional water valve devices converted to use valve entties. These use different icons, so were not picked up in the previous simplistic "valve" search. --- .../devices/garza_irrigation_system.yaml | 19 ++++- .../devices/holman_wx1_taptimer.yaml | 20 +++++- .../devices/holman_wx2_taptimer.yaml | 34 ++++++++- .../holman_wx8_irrigation_controller.yaml | 72 +++++++++++++++++++ .../devices/smart_watering_device.yaml | 18 +++-- tests/test_valve.py | 2 +- 6 files changed, 148 insertions(+), 17 deletions(-) diff --git a/custom_components/tuya_local/devices/garza_irrigation_system.yaml b/custom_components/tuya_local/devices/garza_irrigation_system.yaml index ab78697169..143abe2ed5 100644 --- a/custom_components/tuya_local/devices/garza_irrigation_system.yaml +++ b/custom_components/tuya_local/devices/garza_irrigation_system.yaml @@ -3,18 +3,31 @@ products: - id: xnajzurgqo1ugohn name: Garza ITV103W primary_entity: - entity: switch - icon: "mdi:watering-can" + entity: valve + class: water dps: - id: 108 type: boolean - name: switch + name: valve mapping: - dps_val: true value: false - dps_val: false value: true secondary_entities: + - entity: switch + icon: "mdi:watering-can" + category: config + deprecated: valve + dps: + - id: 108 + type: boolean + name: switch + mapping: + - dps_val: true + value: false + - dps_val: false + value: true - entity: sensor class: battery category: diagnostic diff --git a/custom_components/tuya_local/devices/holman_wx1_taptimer.yaml b/custom_components/tuya_local/devices/holman_wx1_taptimer.yaml index 3452eb2914..bc1a3c7e52 100644 --- a/custom_components/tuya_local/devices/holman_wx1_taptimer.yaml +++ b/custom_components/tuya_local/devices/holman_wx1_taptimer.yaml @@ -4,19 +4,33 @@ products: name: Holman WX1 # DP decoding thanks to funtastix primary_entity: - entity: switch + entity: valve name: Manual - icon: "mdi:watering-can" + class: water dps: - id: 108 type: boolean - name: switch + name: valve mapping: - dps_val: true value: false - dps_val: false value: true secondary_entities: + - entity: switch + name: Manual + category: config + deprecated: valve + icon: "mdi:watering-can" + dps: + - id: 108 + type: boolean + name: switch + mapping: + - dps_val: true + value: false + - dps_val: false + value: true - entity: sensor name: Soil temperature class: temperature diff --git a/custom_components/tuya_local/devices/holman_wx2_taptimer.yaml b/custom_components/tuya_local/devices/holman_wx2_taptimer.yaml index 9baafe1407..63d380a8f4 100644 --- a/custom_components/tuya_local/devices/holman_wx2_taptimer.yaml +++ b/custom_components/tuya_local/devices/holman_wx2_taptimer.yaml @@ -3,21 +3,49 @@ products: - id: wfchjk5vc9bysjtk name: Holman WX2 primary_entity: - entity: switch + entity: valve name: Manual 1 - icon: "mdi:watering-can" + class: water dps: - id: 108 type: boolean - name: switch + name: valve mapping: - dps_val: true value: false - dps_val: false value: true secondary_entities: + - entity: valve + name: Manual 2 + class: water + dps: + - id: 155 + type: boolean + name: valve + mapping: + - dps_val: true + value: false + - dps_val: false + value: true + - entity: switch + name: Manual 1 + category: config + deprecated: valve + icon: "mdi:watering-can" + dps: + - id: 108 + type: boolean + name: switch + mapping: + - dps_val: true + value: false + - dps_val: false + value: true - entity: switch name: Manual 2 + category: config + deprecated: valve icon: "mdi:watering-can" dps: - id: 155 diff --git a/custom_components/tuya_local/devices/holman_wx8_irrigation_controller.yaml b/custom_components/tuya_local/devices/holman_wx8_irrigation_controller.yaml index 9fcc864b4d..271b46a903 100644 --- a/custom_components/tuya_local/devices/holman_wx8_irrigation_controller.yaml +++ b/custom_components/tuya_local/devices/holman_wx8_irrigation_controller.yaml @@ -18,8 +18,66 @@ primary_entity: type: string optional: true secondary_entities: + - entity: valve + name: Zone 1 + class: water + dps: + - id: 102 + type: boolean + name: valve + - entity: valve + name: Zone 2 + class: water + dps: + - id: 103 + type: boolean + name: valve + - entity: valve + name: Zone 3 + class: water + dps: + - id: 104 + type: boolean + name: valve + - entity: valve + name: Zone 4 + class: water + dps: + - id: 104 + type: boolean + name: valve + - entity: valve + name: Zone 5 + class: water + dps: + - id: 106 + type: boolean + name: valve + - entity: valve + name: Zone 6 + class: water + dps: + - id: 107 + type: boolean + name: valve + - entity: valve + name: Zone 7 + class: water + dps: + - id: 108 + type: boolean + name: valve + - entity: valve + name: Zone 8 + class: water + dps: + - id: 112 + type: boolean + name: valve - entity: switch name: Zone 1 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 102 @@ -27,6 +85,8 @@ secondary_entities: name: switch - entity: switch name: Zone 2 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 103 @@ -34,6 +94,8 @@ secondary_entities: name: switch - entity: switch name: Zone 3 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 104 @@ -41,6 +103,8 @@ secondary_entities: name: switch - entity: switch name: Zone 4 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 104 @@ -48,6 +112,8 @@ secondary_entities: name: switch - entity: switch name: Zone 5 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 106 @@ -55,6 +121,8 @@ secondary_entities: name: switch - entity: switch name: Zone 6 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 107 @@ -62,6 +130,8 @@ secondary_entities: name: switch - entity: switch name: Zone 7 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 108 @@ -69,6 +139,8 @@ secondary_entities: name: switch - entity: switch name: Zone 8 + category: config + deprecated: valve icon: mdi:sprinkler-variant dps: - id: 112 diff --git a/custom_components/tuya_local/devices/smart_watering_device.yaml b/custom_components/tuya_local/devices/smart_watering_device.yaml index 605342c2ec..d62cfe641d 100644 --- a/custom_components/tuya_local/devices/smart_watering_device.yaml +++ b/custom_components/tuya_local/devices/smart_watering_device.yaml @@ -3,21 +3,25 @@ products: - id: abzzvtulukkwzynv name: Becasmart BAF-908 primary_entity: - entity: switch + entity: valve + class: water dps: - id: 1 - name: switch + name: valve type: boolean - mapping: - - dps_val: true - icon: mdi:water-pump - - dps_val: false - icon: mdi:water-pump-off - id: 48 type: string optional: true name: schedule secondary_entities: + - entity: switch + category: config + deprecated: valve + icon: "mdi:water-pump" + dps: + - id: 1 + name: switch + type: boolean - entity: select name: Mode icon: "mdi:auto-mode" diff --git a/tests/test_valve.py b/tests/test_valve.py index 896696d417..0f08c2de22 100644 --- a/tests/test_valve.py +++ b/tests/test_valve.py @@ -1,4 +1,4 @@ -""" Tests for the valve entity""" +"""Tests for the valve entity""" from unittest.mock import AsyncMock, Mock