Просмотр исходного кода

Simple switch with timer v2: add power on state and inching dps.

As per issue #435, add these as optional dps.
Inching is only informational, as the format is not easy to work with, but
power on state is a useful setting for those switches that support it.
Jason Rumney 3 лет назад
Родитель
Сommit
b59a6dfa54

+ 24 - 0
custom_components/tuya_local/devices/simple_switch_timerv2.yaml

@@ -2,6 +2,8 @@ name: Simple switch with timer
 products:
   - id: eetmtcempdyxgpx5
     name: Nexxt 220v smartplug
+  - id: 45gg9a0jfyzj1z1d
+    name: Mini smart switch
 primary_entity:
   entity: switch
   class: outlet
@@ -9,6 +11,10 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
+    - id: 42
+      name: inching
+      type: hex
+      optional: true
 secondary_entities:
   - entity: number
     category: config
@@ -25,3 +31,21 @@ secondary_entities:
         mapping:
           - scale: 60
             step: 60
+  - entity: select
+    name: Power on state
+    icon: "mdi:toggle-switch"
+    category: config
+    dps:
+      - id: 38
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "on"
+            value: "On"
+          - dps_val: "off"
+            value: "Off"
+          - dps_val: memory
+            value: Last state
+          - dps_val: null
+            invalid: true

+ 1 - 1
custom_components/tuya_local/manifest.json

@@ -9,5 +9,5 @@
     "iot_class": "local_push",
     "issue_tracker": "https://github.com/make-all/tuya-local/issues",
     "requirements": ["pycryptodome~=3.17","tinytuya==1.10.3"],
-    "version": "2022.2.4"
+    "version": "2022.3.0"
 }