瀏覽代碼

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 2 年之前
父節點
當前提交
c9b5982cb9
共有 1 個文件被更改,包括 30 次插入4 次删除
  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
   - id: bf819f3f0e0f958b17ufid
     name: Arlec PC191HA
     name: Arlec PC191HA
   - id: 2fxr6sttw70cgbau
   - id: 2fxr6sttw70cgbau
-    name: Antella ZY-OYD-Y
+    name: Antela ZY-OYD-Y
+  - id: qiv5hllylfebpl4g
+    name: Eightree ET20
 primary_entity:
 primary_entity:
   entity: switch
   entity: switch
   class: outlet
   class: outlet
@@ -64,7 +66,6 @@ secondary_entities:
         name: sensor
         name: sensor
         type: integer
         type: integer
         class: measurement
         class: measurement
-        force: true
         unit: mA
         unit: mA
       - id: 23
       - id: 23
         type: integer
         type: integer
@@ -78,7 +79,6 @@ secondary_entities:
         name: sensor
         name: sensor
         type: integer
         type: integer
         class: measurement
         class: measurement
-        force: true
         unit: W
         unit: W
         mapping:
         mapping:
           - scale: 10
           - scale: 10
@@ -93,7 +93,6 @@ secondary_entities:
       - id: 20
       - id: 20
         name: sensor
         name: sensor
         type: integer
         type: integer
-        force: true
         class: measurement
         class: measurement
         unit: V
         unit: V
         mapping:
         mapping:
@@ -145,3 +144,30 @@ secondary_entities:
         mapping:
         mapping:
           - dps_val: null
           - dps_val: null
             invalid: true
             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