소스 검색

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