Explorar o código

Smartplugv2 Energy: add compatible Eightree device

Based on that device, add optional child lock and light control, which are
reasonably common on this type of device and do not conflict with other
known matches.

Remove polling, as it is known to cause problems, and this is close enough
to smartplugv2 that smartplugv2_polled can be used if it is needed.

Issue #1061
Jason Rumney %!s(int64=2) %!d(string=hai) anos
pai
achega
c9b5982cb9
Modificáronse 1 ficheiros con 30 adicións e 4 borrados
  1. 30 4
      custom_components/tuya_local/devices/smartplugv2_energy.yaml

+ 30 - 4
custom_components/tuya_local/devices/smartplugv2_energy.yaml

@@ -3,7 +3,9 @@ products:
   - id: bf819f3f0e0f958b17ufid
     name: Arlec PC191HA
   - id: 2fxr6sttw70cgbau
-    name: Antella ZY-OYD-Y
+    name: Antela ZY-OYD-Y
+  - id: qiv5hllylfebpl4g
+    name: Eightree ET20
 primary_entity:
   entity: switch
   class: outlet
@@ -64,7 +66,6 @@ secondary_entities:
         name: sensor
         type: integer
         class: measurement
-        force: true
         unit: mA
       - id: 23
         type: integer
@@ -78,7 +79,6 @@ secondary_entities:
         name: sensor
         type: integer
         class: measurement
-        force: true
         unit: W
         mapping:
           - scale: 10
@@ -93,7 +93,6 @@ secondary_entities:
       - id: 20
         name: sensor
         type: integer
-        force: true
         class: measurement
         unit: V
         mapping:
@@ -145,3 +144,30 @@ secondary_entities:
         mapping:
           - dps_val: null
             invalid: true
+  - entity: select
+    name: Light
+    icon: "mdi:circle-double"
+    category: config
+    dps:
+      - id: 39
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: relay
+            value: State
+          - dps_val: pos
+            value: Position
+          - dps_val: none
+            value: "Off"
+          - dps_val: "on"
+            value: "On"
+  - entity: lock
+    name: Child lock
+    icon: "mdi:hand-back-right-off"
+    category: config
+    dps:
+      - id: 40
+        type: boolean
+        name: lock
+        optional: true