File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
custom_components/label_state Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 3030 "state" ,
3131]
3232
33+ STATE_TO_UNAVAILABLE = "unavailable"
34+ STATE_TO_ON = "on"
35+ STATE_TO_OFF = "off"
36+ STATE_TO_OPTIONS = [STATE_TO_UNAVAILABLE , STATE_TO_ON , STATE_TO_OFF ]
37+
3338
3439OPTIONS_SCHEMA_NUMERIC_STATE = vol .Schema (
3540 {
5055OPTIONS_SCHEMA_STATE = vol .Schema (
5156 {
5257 vol .Required (CONF_LABEL ): selector .LabelSelector (),
53- vol .Required (CONF_STATE_TO ): selector .TextSelector (),
58+ vol .Required (CONF_STATE_TO ): selector .SelectSelector (
59+ selector .SelectSelectorConfig (
60+ options = STATE_TO_OPTIONS ,
61+ translation_key = "state_to" ,
62+ custom_value = True ,
63+ )
64+ ),
5465 }
5566)
5667
Original file line number Diff line number Diff line change 5656 }
5757 }
5858 }
59+ },
60+ "selector" : {
61+ "state_to" : {
62+ "options" : {
63+ "unavailable" : " Unavailable" ,
64+ "on" : " On" ,
65+ "off" : " Off"
66+ }
67+ }
5968 }
6069}
Original file line number Diff line number Diff line change 5656 }
5757 }
5858 }
59+ },
60+ "selector" : {
61+ "state_to" : {
62+ "options" : {
63+ "unavailable" : " Unavailable" ,
64+ "on" : " On" ,
65+ "off" : " Off"
66+ }
67+ }
5968 }
6069}
You can’t perform that action at this time.
0 commit comments