Explorar el Código

Somgom single switch: allow init when initial state is missing

Initial state dp is optional, but there was no listing for the null case.
List the options so that the select entity is created correctly.

Issue #1487
Jason Rumney hace 2 años
padre
commit
2ef33b74a8

+ 9 - 0
custom_components/tuya_local/devices/somgom_single_switch.yaml

@@ -52,6 +52,15 @@ secondary_entities:
                     value: "On"
                     value: "On"
                   - dps_val: memory
                   - dps_val: memory
                     value: Last state
                     value: Last state
+              # during startup there may be no value, but we need to know the options
+              - dps_val: null
+                mapping:
+                  - dps_val: "off"
+                    value: "Off"
+                  - dps_val: "on"
+                    value: "On"
+                  - dps_val: memory
+                    value: "Last state"
   - entity: light
   - entity: light
     name: Backlight
     name: Backlight
     category: config
     category: config