Ver código fonte

Quad powerstrip: separate into sensor and non-sensor configs.

- revert optional sensor changes (was previously working with whatever
  device it was made for) to avoid misdetection
- add new config quad_power_timer for the non-sensor version

Issue #1031
Jason Rumney 2 anos atrás
pai
commit
112178d163

+ 2 - 1
ACKNOWLEDGEMENTS.md

@@ -347,5 +347,6 @@ Further device support has been made with the assistance of users.  Please consi
 - [andbuitra](https://github.com/andbuitra) for contributing support for Xiumii human presence mmWave radar sensors.
 - [jonpetersathan](https://github.com/jonpetersathan) for contributing support for Djive humidifying fans and Woods Cortina air conditioner.
 - [omahs](https://github.com/omahs) for contributing documentation improvements.
-- [pdecat](https://github.com/pdecat) for assisting with support for Blumfeldt Cosmic Beam radiant heaters.
+- [pdecat](https://github.com/pdecat) for assisting with support for Blumfeldt Cosmic Beam radiant heaters and Pearl Xystec USB hub (quad_power_timer).
 - [andr2000](https://github.com/andr2000) for assisting with support for Abir X8 vacuums.
+

+ 1 - 1
DEVICES.md

@@ -321,7 +321,7 @@ of device.
   _confirmed working as a simple switch and timer with Kashimura KJ-173_
 - Generic double switch with timers (confirmed with Living dual switch and another v2 variant with Avatto dual switch)
 - Generic triple and quad switches (confirmed with Songam wall switches)
-- Generic triple switch with timers.
+- Generic triple and quad switches with timers (confirmed with Pearl Xystec USB hub).
 - Simple switch - a switch only, can be a fallback for many other unsupported devices, to allow just power to be switched on/off.
 - Simple switch with timer - a single switch and timer, will probably work for a lot of smart switches that are not covered by the more advanced configs above.
 - Simple switch with timer v2 - the above with timer moved from dp 11 to 9, confirmed with a Nexxt 220V smart switch.

+ 91 - 0
custom_components/tuya_local/devices/quad_power_timer.yaml

@@ -0,0 +1,91 @@
+name: Quad powerstrip
+products:
+  - id: ckg60n4x6qakegxo
+    name: Pearl Xystec NX-4986-919 4xUSB
+primary_entity:
+  entity: switch
+  name: Outlet 1
+  class: outlet
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+secondary_entities:
+  - entity: switch
+    name: Outlet 2
+    dps:
+      - id: 2
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Outlet 3
+    dps:
+      - id: 3
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Outlet 4
+    dps:
+      - id: 4
+        type: boolean
+        name: switch
+  - entity: number
+    name: Timer 1
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 9
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    name: Timer 2
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 10
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    name: Timer 3
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 11
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    name: Timer 4
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 12
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60

+ 0 - 5
custom_components/tuya_local/devices/quad_powerstrip.yaml

@@ -2,8 +2,6 @@ name: Quad powerstrip
 products:
   - id: l5gnaxuawkjfquqo
     name: Kogan KASPS10A3P3UA 3+USB
-  - id: ckg60n4x6qakegxo
-    name: Pearl Xystec NX-4986-919 4xUSB
 primary_entity:
   entity: switch
   name: Outlet 1
@@ -108,7 +106,6 @@ secondary_entities:
         type: integer
         class: measurement
         force: true
-        optional: true
         unit: mA
       - id: 23
         type: integer
@@ -123,7 +120,6 @@ secondary_entities:
         type: integer
         class: measurement
         force: true
-        optional: true
         unit: W
         mapping:
           - scale: 10
@@ -140,7 +136,6 @@ secondary_entities:
         type: integer
         class: measurement
         force: true
-        optional: true
         unit: V
         mapping:
           - scale: 10