فهرست منبع

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 2 سال پیش
والد
کامیت
2ef33b74a8
1فایلهای تغییر یافته به همراه9 افزوده شده و 0 حذف شده
  1. 9 0
      custom_components/tuya_local/devices/somgom_single_switch.yaml

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

@@ -52,6 +52,15 @@ secondary_entities:
                     value: "On"
                   - dps_val: memory
                     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
     name: Backlight
     category: config