Răsfoiți Sursa

Screen sync light: make switch optional, remove timer

Based on feedback on #264, switch is sometimes not returned, so must be optional to reliably detect the light.  Timer is also often not returned.  Since the entities are not designed to handle all attributes missing, move it to an attribute of the light (where it will be read-only when it is returned).
Jason Rumney 3 ani în urmă
părinte
comite
745f471e5e
1 a modificat fișierele cu 5 adăugiri și 17 ștergeri
  1. 5 17
      custom_components/tuya_local/devices/screensync_light.yaml

+ 5 - 17
custom_components/tuya_local/devices/screensync_light.yaml

@@ -5,6 +5,7 @@ primary_entity:
     - id: 20
     - id: 20
       type: boolean
       type: boolean
       name: switch
       name: switch
+      optional: true
     - id: 21
     - id: 21
       type: string
       type: string
       name: color_mode
       name: color_mode
@@ -42,7 +43,6 @@ primary_entity:
           range:
           range:
             min: 0
             min: 0
             max: 1000
             max: 1000
-      optional: true
     - id: 25
     - id: 25
       type: hex
       type: hex
       name: effect
       name: effect
@@ -110,19 +110,7 @@ primary_entity:
       type: string
       type: string
       name: scene
       name: scene
       optional: true
       optional: true
-secondary_entities:
-  - entity: number
-    name: Timer
-    category: config
-    icon: "mdi:timer"
-    dps:
-      - id: 26
-        name: value
-        type: integer
-        range:
-          min: 0
-          max: 86400
-        unit: min
-        mapping:
-          - scale: 60
-            step: 60
+    - id: 26
+      name: timer
+      type: integer
+      optional: true