Procházet zdrojové kódy

feat (devices): add ElectriQ CD20PRO-LE-V4 dehumidifier

- electriq_cd20pro_dehumidifier: add product id for compatible CD12PRO-LE variant

Issue #4029

- (unrelated): modify lock tests for recent changes
Jason Rumney před 2 měsíci
rodič
revize
3d6ba74372

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -1133,3 +1133,4 @@ Further device support has been made with the assistance of users. Please consid
 - [H4irBear](https://github.com/H4irBear) for contributing support for Orbegozo RRW heater.
 - [steaura](https://github.com/steaura) for contributing improvements to Electriq CD12 Pro dehumidifier.
 - [rickbergmans](https://github.com/rickbergmans) for contributing support for Pilot Wire RP5 bath thermostat.
+- [baracici](https://github.com/baracici) for assisting with support for ElectriQ CD20PRO-LE-V4 dehumidifier.

+ 1 - 1
DEVICES.md

@@ -409,7 +409,7 @@
 - Dura Comfort DH50PWM dehumidifier
 - Ebac DJ4000 dehumidifier
 - Eberg Rico R12E2 dehumidifier
-- ElectriQ CD12PRO-LE, CD12PW, CD20PRO-LE-V2, CD25PRO-LE-V2 dehumidifiers
+- ElectriQ CD12PRO-LE, CD12PW, CD20PRO-LE-V2/V4, CD25PRO-LE-V2 dehumidifiers
 - ElectriQ DESD9LW dehumidifier (two variants)
 - Electriq PD45E dehumidifier
 - Eeese Adam, Anna, Carl, Emil, Otto dehumidifiers

+ 4 - 12
custom_components/tuya_local/devices/electriq_cd20pro_dehumidifier.yaml

@@ -10,6 +10,9 @@ products:
   - id: m0wtqltrepknlpdj
     manufacturer: Morris
     model: Premier Plus
+  - id: lovfhvt2xkrexf8z
+    manufacturer: Electriq
+    model: CD12PRO-LE
 entities:
   - entity: humidifier
     class: dehumidifier
@@ -17,13 +20,6 @@ entities:
       - id: 1
         name: switch
         type: boolean
-        mapping:
-          - dps_val: false
-            icon: "mdi:air-humidifier-off"
-            icon_priority: 1
-          - dps_val: true
-            icon: "mdi:air-humidifier"
-            icon_priority: 3
       - id: 2
         name: mode
         type: string
@@ -34,13 +30,9 @@ entities:
           - dps_val: low
             value: eco
           - dps_val: high
-            value: boost
-            icon: "mdi:tshirt-crew-outline"
-            icon_priority: 2
+            value: laundry
           - dps_val: fan
             value: purify
-            icon: "mdi:air-purifier"
-            icon_priority: 2
       - id: 3
         type: integer
         name: current_humidity

+ 116 - 0
custom_components/tuya_local/devices/electriq_cd20prolev4_dehumidifier.yaml

@@ -0,0 +1,116 @@
+name: Dehumidifier
+products:
+  - id: qdxoacewdnbqrgeh
+    manufacturer: ElectriQ
+    model: CD20PRO-LE-V4
+entities:
+  - entity: humidifier
+    class: dehumidifier
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 2
+        type: integer
+        name: humidity
+        range:
+          min: 35
+          max: 80
+        mapping:
+          - step: 5
+      - id: 3
+        type: integer
+        name: current_humidity
+      - id: 5
+        type: string
+        name: mode
+        mapping:
+          - dps_val: Smart
+            value: auto
+          - dps_val: Dry
+            value: normal
+          - dps_val: Fan
+            value: purify
+          - dps_val: Laundry
+            value: laundry
+  - entity: fan
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 4
+        type: string
+        name: speed
+        mapping:
+          - dps_val: F1
+            value: 16
+          - dps_val: F2
+            value: 33
+          - dps_val: F3
+            value: 50
+          - dps_val: F4
+            value: 66
+          - dps_val: F5
+            value: 83
+          - dps_val: F6
+            value: 100
+      - id: 102
+        type: boolean
+        name: oscillate
+  - entity: switch
+    translation_key: ionizer
+    category: config
+    dps:
+      - id: 10
+        type: boolean
+        name: switch
+  - entity: switch
+    translation_key: uv_sterilization
+    category: config
+    dps:
+      - id: 13
+        type: boolean
+        name: switch
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 16
+        type: boolean
+        name: lock
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 19
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code
+  - entity: light
+    translation_key: display
+    category: config
+    dps:
+      - id: 101
+        type: boolean
+        name: switch
+  - entity: sensor
+    class: temperature
+    dps:
+      - id: 103
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+  - entity: switch
+    translation_key: sleep
+    category: config
+    dps:
+      - id: 104
+        type: boolean
+        name: switch

+ 3 - 3
tests/devices/test_ailrinni_fplock.py

@@ -51,9 +51,9 @@ class TestAilrinniFingerprintLock(TuyaDeviceTestCase):
 
     async def test_lock(self):
         """Test locking the lock."""
-        expected = b64encode(b"\x00" + b"\x00\x01" + b"12345678" + b"\x00\x00").decode(
-            "utf-8"
-        )
+        expected = b64encode(
+            b"\x00" + b"\x00\x01" + b"12345678" + b"\x00\x00
+        ).decode("utf-8")
         async with assert_device_properties_set(
             self.subject._device,
             {CODE_UNLOCK_DP: expected},