File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed
homeassistant/components/androidtv Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 3939 CONF_TURN_OFF_COMMAND ,
4040 CONF_TURN_ON_COMMAND ,
4141 DEFAULT_ADB_SERVER_PORT ,
42- DEFAULT_DEVICE_CLASS ,
4342 DEFAULT_EXCLUDE_UNNAMED_APPS ,
4443 DEFAULT_GET_SOURCES ,
4544 DEFAULT_PORT ,
4645 DEFAULT_SCREENCAP_INTERVAL ,
46+ DEVICE_AUTO ,
4747 DEVICE_CLASSES ,
4848 DOMAIN ,
4949 PROP_ETHMAC ,
@@ -89,8 +89,14 @@ def _show_setup_form(
8989 data_schema = vol .Schema (
9090 {
9191 vol .Required (CONF_HOST , default = host ): str ,
92- vol .Required (CONF_DEVICE_CLASS , default = DEFAULT_DEVICE_CLASS ): vol .In (
93- DEVICE_CLASSES
92+ vol .Required (CONF_DEVICE_CLASS , default = DEVICE_AUTO ): SelectSelector (
93+ SelectSelectorConfig (
94+ options = [
95+ SelectOptionDict (value = k , label = v )
96+ for k , v in DEVICE_CLASSES .items ()
97+ ],
98+ translation_key = "device_class" ,
99+ )
94100 ),
95101 vol .Required (CONF_PORT , default = DEFAULT_PORT ): cv .port ,
96102 },
Original file line number Diff line number Diff line change 1515CONF_TURN_ON_COMMAND = "turn_on_command"
1616
1717DEFAULT_ADB_SERVER_PORT = 5037
18- DEFAULT_DEVICE_CLASS = "auto"
1918DEFAULT_EXCLUDE_UNNAMED_APPS = False
2019DEFAULT_GET_SOURCES = True
2120DEFAULT_PORT = 5555
2221DEFAULT_SCREENCAP_INTERVAL = 5
2322
23+ DEVICE_AUTO = "auto"
2424DEVICE_ANDROIDTV = "androidtv"
2525DEVICE_FIRETV = "firetv"
26- DEVICE_CLASSES = [DEFAULT_DEVICE_CLASS , DEVICE_ANDROIDTV , DEVICE_FIRETV ]
26+ DEVICE_CLASSES = {
27+ DEVICE_AUTO : "auto" ,
28+ DEVICE_ANDROIDTV : "Android TV" ,
29+ DEVICE_FIRETV : "Fire TV" ,
30+ }
2731
2832PROP_ETHMAC = "ethmac"
2933PROP_SERIALNO = "serialno"
Original file line number Diff line number Diff line change 6565 }
6666 }
6767 },
68+ "selector" : {
69+ "device_class" : {
70+ "options" : {
71+ "auto" : " Auto-detect device type"
72+ }
73+ }
74+ },
6875 "services" : {
6976 "adb_command" : {
7077 "description" : " Sends an ADB command to an Android / Fire TV device." ,
You can’t perform that action at this time.
0 commit comments